Skip to main content
altKey property

Gets a value that indicates whether the Alt key is pressed.

Document Object Model (DOM) Level 3 Events Specification, Section 5.2.2

Syntax

JavaScript

p = object.altKey

Property values

Type: Boolean

true (true)

The Alt key is pressed.

false (false)

The Alt key is not pressed.

Standards information

Remarks

To determine whether the left or right version of the Alt key is pressed, use the location property.

See also

DragEvent
event
KeyboardEvent
MouseEvent
MouseWheelEvent
WheelEvent
Reference
ctrlKey
getModifierState
metaKey
shiftKey