altKey Event Attribute
Definition and Usage
The altKey event attribute returns a Boolean value that indicates whether or not the "ALT" key was pressed when an event was triggered.
The following example alerts whether or not the "ALT" key was pressed when a
mouse button is clicked:
Try it yourself »
alert("The ALT key was pressed!")
alert("The ALT key was NOT pressed!")
<p>Click somewhere in the document.
An alert box will tell you if you
pressed the ALT key or not.</p>
Thank You For Helping Us!
Your message has been sent to W3Schools.