You are here: Reference > JavaScript > client-side > event handling > properties > metaKey (event)

metaKey property (event)

Browser support:
9
Retrieves a Boolean value that indicates whether the META key was down at the time when the event occurred.

Syntax:

object.metaKey;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Boolean that represents one of the following values:
false
META key is up.
true
META key is down.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the metaKey property:
<head>
    <script type="text/javascript">
        function GetMetaKey (event) {
            if ('metaKey' in event) {
                alert (event.metaKey);
            } else {
                alert ("Your browser doesn't support event.metaKey property.");
            }
        }
    </script>
</head>
<body>
    <button onclick="GetMetaKey (event);">Get meta key state!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content