HTML DOM | KeyboardEvent altKey Property
The KeyboardEvent altKey property in HTML DOM is a read-only property and used to return the boolean value which indicates the alt key is pressed or not. It returns True if alt key is pressed otherwise return false.
Below program illustrates the KeyboardEvent altkey property in HTML:
Example: This example check whether the “ALT” key is pressed or not.
Before Press the Key:
After Press the key:
Supported Browsers: The browser supported by KeyboardEvent altKey property are listed below:
- Opera 12.1
- Internet Explorer 9
- Google Chrome 1
- Edge 12
- Firefox 1.5
- Apple Safari 1.2