Keyboard Events
JavaScript FAQ
|
Keyboard & Mouse Events FAQ
How do I analyze keyboard events in JavaScript?
Which key did the user press?
Which character did the user type?
Are there predefined constants with
key code
values?
Are the keydown event
key codes
standardized across browsers?
Can I use JavaScript to allow
digits only
in a text input field?
How do I detect keyboard events with Ctrl, Alt, and Shift keys?
The following questions are applicable to keyboard events as well as mouse events:
How do I add an event handler to an HTML page element?
How do I remove an event handler from a page element?
What is
event bubbling
?
How do I cancel event bubbling?
How do I prevent the browser's default action in a JavaScript event handler?
How do I determine the event's target element?
Copyright
© 1999-2011,
JavaScripter.net
.