We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE

event.altKey Redirect 1

« DOM Reference


Indicates whether the ALT key was pressed when the event fired.




var bool = event.altKey;

bool contains true or false, depending on whether the alt key was held down or not, when the event fired.

<title>altKey example</title>

<script type="text/javascript">

function showChar(e){
    "Key Pressed: " + String.fromCharCode(e.charCode) + "\n"
    + "charCode: " + e.charCode + "\n"
    + "ALT key pressed: " + e.altKey + "\n"


<body onkeypress="showChar(event);">
Press any character key,
with or without holding down the ALT key.<br />
You can also use the SHIFT key together with the ALT key.


DOM Level 2 Events - property of MouseEvent object

Document Tags and Contributors

 Last updated by: Sheppy,