javascript Club
가입하기
Fanpop
New Post
Explore Fanpop
In this post, 당신 can test yourself on which key 당신 were pressed. When 당신 get this event contains all the event information that 당신 might need to write your own code.

Sometimes 당신 need to prevent some keyboard key operations like prevent to select all text, copy, paste, etc. At that time 당신 need to write a JavaScript keyboard event function to handle it as per your need.

link
The following JavaScript code, when a keypress event fires, 당신 will get all event properties. For example, when 당신 pressing “1”, 당신 will get “49” value. It is recommended to write logic on an event.which instead of event.keyCode and event.charCode.