This page is Not Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

keyCode

Property of dom/KeyboardEventdom/KeyboardEvent

Syntax

var result = element.keyCode;
element.keyCode = value;

Notes

Remarks

The keyCode property represents the character code during the onkeypress event and the unmodified scan code of the key during onkeydown and onkeyup events. To detect whether the Alt, Ctrl, Meta, or Shift key is also pressed, see the altKey, ctrlKey, metaKey, or shiftKey property of the event. The keyCode property is provided for compatibility only. The latest version of the Document Object Model (DOM) Events specification defines a key property instead.

Syntax

Standards information

Attributions