|
shiftKey Event Attribute
Complete Event Object Reference
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.
Syntax
|
event.shiftKey=true|false|1|0
|
Example
The following example alerts whether or not the "SHIFT" key was pressed when
a mouse button is clicked:
<html>
<head>
<script type="text/javascript">
function isKeyPressed(event)
{
if (event.shiftKey==1)
{
alert("The shift key was pressed!")
}
else
{
alert("The shift key was NOT pressed!")
}
}
</script>
</head>
<body onmousedown="isKeyPressed(event)">
<p>Click somewhere in the document.
An alert box will tell you if you
pressed the shift key or not.</p>
</body>
</html>
|
|
Complete Event Object Reference
729,913 sites built with Wix. Make your own
Click here to design a Stunning Flash Website for Free
Wix is a revolutionary web design tool that provides anyone with the possibility to create professional and beautiful websites for free.
With e-commerce features, search engine visibility and many more professional tools, Wix is the ultimate solution for creating a spectacular site while saving tons of money.
|