javascript Club
kom bij
Fanpop
New Post
Explore Fanpop
In this post, u can test yourself on which key u were pressed. When u get this event contains all the event information that u might need to write your own code.

Sometimes u need to prevent some keyboard key operations like prevent to select all text, copy, paste, etc. At that time u 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, u will get all event properties. For example, when u pressing “1”, u will get “49” value. It is recommended to write logic on an event.which instead of event.keyCode and event.charCode.