The keyboardEvent key property in HTML is used to return the value of key pressed when a key event occurs. It returns a single character or multi character string depending on which key is pressed. It is a read-only property.
Return Value: It returns a string which represents the key pressed.
- It can return single character string like “a”, “5”, “+”, etc.
- It can return multi character string like “F5”, “Enter”, “HOME”, etc.
Supported Browsers: The browser supported by keyboardEvent key property are listed below:
- Apple Safari Not supported
- Google Chrome 51.0
- Firefox 23.0
- Opera 38.0
- Internet Explorer 9.0
- HTML | DOM KeyboardEvent shiftKey Property
- HTML | DOM KeyboardEvent code Property
- HTML | DOM keyboardEvent charCode Property
- HTML DOM | KeyboardEvent altKey Property
- HTML | DOM KeyboardEvent metaKey Property
- HTML | DOM KeyboardEvent location Property
- HTML | DOM KeyboardEvent keyCode Property
- HTML | DOM KeyboardEvent getModifierState() Method
- HTML | DOM KeyboardEvent
- HTML | KeyboardEvent which Property
- HTML | DOM Storage key() Method
- How to add Google map inside html page without using API key ?
- HTML | DOM lang Property
- HTML | DOM Style backgroundClip Property
- HTML | DOM Style borderTop Property
- HTML | DOM Meter max Property
- HTML | DOM Input Hidden value Property
- HTML | DOM Textarea autofocus Property
- HTML | DOM Style columnGap Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.