metaKey Event Attribute
Complete Event Object Reference
Definition and Usage
The metaKey event attribute returns a Boolean value that indicates whether or not the "meta" key was
pressed when an event was triggered.
Syntax
Example
The following example alerts whether or not the "meta" key was pressed when a
mouse button was clicked:
<html>
<head>
<script type="text/javascript">
function isKeyPressed(event)
{
if (event.metaKey==1)
{
alert("The meta key was pressed!")
}
else
{
alert("The meta 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 meta key or not.</p>
</body>
</html>
|
Try-It-Yourself Demos
metaKey - Check whether or not the meta key is pressed
Complete Event Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|