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