HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Get the location of the key
The location property returns a number that indicates the location of a key on the keyboard or device.
The number is represented by 4 constants:
The key is not pressed on the right or left side of the keyboard, and was not pressed on the numeric keypad (this value represents almost every key on the keyboard, e.g. "A", "U", "SPACE" or "5")
A left key was pressed (e.g. the left "CTRL" key or left "ALT" key on a standard 101 key US keyboard)
A right key was pressed (e.g. the right "CTRL" key or right "CTRL" key on a standard 101 key US keyboard)
The key was pressed on the numeric keypad (e.g. the "2" key on the right side on a standard keyboard)
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
location | Yes | 9.0 | 15.0 | Not supported | Yes |
Return Value: |
A Number, representing the location of a key on the keyboard or device The number is represented by 4 constants: 0. DOM_KEY_LOCATION_STANDARD |
---|---|
DOM Version: | DOM Level 3 Events |