As for e.keyCode VS e.which... From my tests, Chrome and IE8: the keypress() handler will only get triggered for normal characters (i.e. not Up/Down/Ctrl), and both e.keyCode and e.which will return the ASCII code. In Firefox however, all keys will trigger keypress(), BUT: for normal characters e.which will return the ASCII code and e.keyCode will return 0, and for special characters (e.g. Up/Down/Ctrl) e.keyCode will return the keyboard code, and e.which will return 0. How fun.