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

metaKey property (event)

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


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:
META key is up.
META key is down.
Default: this property has no default value.

Example HTML code 1:

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

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content