Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

key property

Gets the key identifier of a key that is pressed.

Document Object Model (DOM) Level 3 Events Specification, Section 5.2.6Internet Explorer 9

 

Syntax

JavaScript

p = object.key

 

Property values

Type: String

A key identifier.

Standards information

Remarks

Key identifiers are strings that uniquely identify keyboard buttons, such as Q, Home, or F2. The string can be any of the following types:

  • Character string: A single character, such as a letter or symbol
  • Key name: A multicharacter string such as Enter or Tab
  • Unicode codepoint: "U+" followed by a hexadecimal character index

See also

KeyboardEvent
Key Identifiers

 

 

Show:
© 2017 Microsoft