IdiaeresisKeycode 249 = odiaeresis OdiaeresisKeycode 250 = udiaeresis UdiaeresisKey code 251 = ssharp question backslashKeycode 252 = asciicircum degreeKeycode 253 = 3 sterlingKeycode 254 = Mode_switchUseEvent. The keyCode value is 37, 38, 39, and 40. The cursor of the corresponding pressed direction is left, top, right, bottom."Javascript: if (event. keyCode If
Introduction:When you write a Javascript script, you need to obtain the corresponding value before performing corresponding operations on the buttons. The following lists the values of all JavaScript keycode keys.
Special attention:
Determine whether the ctrl key is pressed: Use event. ctrlkey
Determine whether shift is pressed: Use event. shiftkey
Judge whet
The keycode value of the keyboard is a useful element when an event is triggered when writing javascript. You can add it to your favorites. Keycode 0 =
Keycode 1 =
Keycode 2 =
Keycode 3 =
Keyc
KeyCode in Javascript)
Key code key code
A 65 J 74 S 83 1 49
B 66 K 75 T 84 2 50
C 67 L 76 U 85 3 51
D 68 M 77 V 86 4 52
E 69 N 78 W 87 5 53
F 70 O 79X88 6 54
G 71 P 80 Y 89 7 55
H 72 Q 81 Z 90 8 56
I 73 R 82 0 48 9 57
KeyCode function keyCode)
Key code key code
0 96 8 104 F1 112 F7 118
1 97 9 105 F2 113 F8 119
2
Window. event. keyCode is compatible with the specific implementation code of IE and Firefox as follows. If you are interested, refer to the following HTML code.
The Code is as follows:
Javascript code
The Code is as follows:
Function keyNumAll (evt ){// Compatible with IE and Firefox to obtain keyBoardEvent objectsEvt = (evt )? Evt: (window. event )? Window. event :"");Var key = evt.
compatibility issues that you can use together with the which and KeyCode properties to resolve:var x = Event.which | | Event.keycode; UsewhichOrKeyCode, which supports different browsersTip: List of all Unicode characters to view our full Unicode reference manual.Tip: If you need to convert Unicode values to characters, you can use the fromCharCode () method.Note: This property is read-only.Note: the whic
I used to test my website in IE8. Some of the Code that was written later failed and I had to download Firefox and its plug-in Firebug to find that FF does not support windows. event. So I changed my mind. HTML
The Code is as follows:
Javascript
The Code is as follows:
Function submit1 (e ){Var isie = (document. all )? True: false; // determines whether the kernel is IE or Mozilla.Var key;If (isie)Key = window. event.
UdiaeresisKey code 251 = ssharp question backslashKeycode 252 = asciicircum degreeKeycode 253 = 3 sterlingKeycode 254 = Mode_switchUseEvent. The keyCode value is 37, 38, 39, and 40. The cursor of the corresponding pressed direction is left, top, right, bottom."Javascript: if (event. keyCode If (event. keycode = 13) in
direction of the press is left, top, right, bottom"Javascript:if (Event.keycode if (event.keycode==13) means that the press-enter keyboard is pressed"Javascript:if (Event.keycode > event.keycode Javascript Document**********************************************************************Use JavaScript to intercept keyboard input in a Web pageUse the KeyCode propert
Event. keyCode value table in Javascript
Key value for letters and numbers)
Buttons
Key code
Buttons
Key code
Buttons
Key code
Buttons
Key code
A
65
J
74
S
83
1
49
B
66
K
75
T
84
// JavaScript document
**************************************** ******************************Use JavaScript to intercept keyboard input on the web pageUse the keycode attribute of the event object to determine the Input key valueEg: If (event. keycode = 13) Alert ("Enter !");Key value tableA 0x65 u 0x85B 0x66 v 0x
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.