Easy Tutorial
❮ Jsref Sub Prop Fieldset Name ❯

altKey Event Property


Definition and Usage

The altKey event property returns a Boolean value. It indicates whether the Alt key was pressed and held down during the specified event.

Syntax


Example

Example

The following example prompts whether the "ALT" key was held down when the mouse button was clicked:

function isKeyPressed(event){
    if (event.altKey==1){
        alert(" ALT key is pressed!");
    }else{
        alert(" ALT key is not pressed!");
    }
}

❮ Jsref Sub Prop Fieldset Name ❯