开发者

jQuery keyup keyCode doesn't work in Opera

开发者 https://www.devze.com 2023-01-13 22:40 出处:网络
Is it possible that the opera browser ignore the keyCode 40 (arrow down)? $(\'#test\').keyup(function(e) {

Is it possible that the opera browser ignore the keyCode 40 (arrow down)?

 $('#test').keyup(function(e) {
        $('body').append('' + e.keyCode + '');
 })

Test it at: http://www.jsfiddle.net/V9Euk/454/

Tha开发者_开发问答nks in advance!

Peter


Try to use the autocomplete attribute, and set it to off:

<input id="test" value="" autocomplete="off" >

Opera uses the arrow down key for auto completion, and may therefore suppress the forwarding of the event.

Working test: http://www.jsfiddle.net/V9Euk/455/


Yes, this does not work (seems like opera does not support it). Have a look at this test page from www.w3.org showing you what your broswer detects (keyup is not fired).

0

精彩评论

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