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