Latest web development tutorials

metaKey event properties

Event Object Reference Event objects

Definition and Usage

metaKey Events property returns a Boolean value that indicates when an event occurs, "meta" key is pressed and hold.

grammar

event.metaKey


Examples

Examples

The following example prompts when the mouse button is clicked "meta" key is held down:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function isKeyPressed (event) {
if (event.metaKey == 1) {
alert ( "meta key is pressed!");
} Else {
alert ( "meta key is not pressed!");
}
}
</ Script>
</ Head>
<Body onmousedown = "isKeyPressed (event)">

<P> Click somewhere in the document. An alert box will tell you whether you press the meta key. </ P>

</ Body>
</ Html>

try it"


Event Object Reference Event objects