KeyboardEvent code property
Definition and usage
The code property returns the key that triggered the event.
Note:This property returns different values for different keyboard layouts.
Tip:To ensure that the correct character is returned, please use event.key.
Syntax
event.code
Technical details
Return value: | String value representing the key pressed. |
---|
Browser support
Eigenschaften | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
code | 48 | Nicht unterstützt | 32 | 10 | Unterstützung |
Verwandte Seiten
HTML DOM Referenzhandbuch:KeyboardEvent key-Eigenschaft
HTML DOM Referenzhandbuch:KeyboardEvent charCode-Eigenschaft
HTML DOM Referenzhandbuch:KeyboardEvent keyCode-Eigenschaft