问题
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/
Thanks in advance!
Peter
回答1:
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/
回答2:
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).
来源:https://stackoverflow.com/questions/3624812/jquery-keyup-keycode-doesnt-work-in-opera