Possible Duplicate:
FULL list of JavaScript keycodes
Where can I found the official reference of the key codes in javascript?
Google founds only gappy tables.
Especially I'm looking for the key code of double quote.
Possible Duplicate:
FULL list of JavaScript keycodes
Where can I found the official reference of the key codes in javascript?
Google founds only gappy tables.
Especially I'm looking for the key code of double quote.
If you're testing for typed characters (as opposed to detecting non-printable keystrokes) then you do not need a look-up table. Use the keypress
event and you can get the character code and hence typed character from the event in any major browser:
document.onkeypress = function(evt) {
evt = evt || window.event;
var charCode = (typeof evt.which == "number") ? evt.which : evt.keyCode;
if (String.fromCharCode(charCode) == '"') {
alert("Double quote typed");
}
};
Personnally I use this list : http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes And this is kind of a reference for JS keyboard events : http://unixpapa.com/js/key.html
Key code for doube quote
is 34 222 (Mozzila, firefox, IE) similar question is already asked here: What are the JavaScript KeyCodes?