$('input').keypress(function(e){
var k = e.keyCode ? e.keyCode : e.which;
console.log(k);
});
<input type="text" name="" autocomplete="off"/>
In FF for '.' (point) and for 'delete' it is th开发者_如何转开发e same code 46. AND for 'right' (right arrow) and for ' it is the same code 39. just to be 'safe' Chrome and IE7 don't fire nothing for keys like arrows, delete, insert, backspace etc
Not really a bug per-say, just one of the many browser differences. If you look on your number-pad, they are the same key, their mapping points to that key.
精彩评论