The mouseEvent altKey property is used to define whether the alt key is pressed or not. It is a boolean value. When alt key is pressed then onclick of the mouse buttons it returns true and if it is not pressed then it returns false.
Return Value: It returns a boolean value indicating whether alt key is pressed or not.
- true: it indicates alt key is pressed
- false: it indicates alt key is not pressed
Clicking button (Alt key is not pressed):
Clicking button (Alt key is pressed):
Supported Browsers: The browser supported by altkey property are listed below:
- Apple Safari
- Google Chrome
- Internet Explorer
- HTML DOM | KeyboardEvent altKey Property
- HTML | DOM TouchEvent altKey Property
- HTML | DOM MouseEvent pageX Property
- HTML | DOM MouseEvent screenY Property
- HTML | DOM MouseEvent relatedTarget Property
- HTML | DOM MouseEvent pageY Property
- HTML | DOM MouseEvent clientY Property
- HTML | DOM MouseEvent screenX Property
- HTML | DOM MouseEvent offsetX Property
- HTML | DOM MouseEvent offsetY 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.