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:
- Internet Explorer
- Google Chrome
- Apple Safari
- HTML | DOM TouchEvent altKey Property
- HTML | DOM KeyboardEvent key Property
- HTML | KeyboardEvent which Property
- HTML | DOM KeyboardEvent location Property
- HTML | DOM KeyboardEvent keyCode Property
- HTML | DOM KeyboardEvent metaKey Property
- HTML | DOM keyboardEvent charCode Property
- HTML | DOM KeyboardEvent code Property
- HTML | DOM KeyboardEvent shiftKey Property
- HTML | DOM KeyboardEvent
- HTML | DOM KeyboardEvent getModifierState() Method
- HTML | DOM specified Property
- HTML | DOM value Property
- HTML | DOM dir 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 firstname.lastname@example.org. 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.