开发者

keypress bug in FF?

开发者 https://www.devze.com 2022-12-18 05:36 出处:网络
$(\'input\').keypress(function(e){ var k = e.keyCode ? e.keyCode : e.which; console.log(k); }); <input type=\"text\" name=\"\"autocomplete=\"off\"/>
$('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.

0

精彩评论

暂无评论...
验证码 换一张
取 消