views:

107

answers:

3

Hi,
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

A: 

Does this help?

http://www.quirksmode.org/js/keys.html

Rob Olmos
+1  A: 

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).

Thariama
Thank you very much. The page is nice ;).Keycode 40 works only with keypress or keydown in opera.
Peter
i have this page in my bookmark pane - need it a lot for all those nasty different browsers :)
Thariama
+3  A: 

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/

Giu
Thats it! Thank you!
Peter
@Peter You're welcome!
Giu
+1 very nice solution
Thariama
You could also cancel the default action of the key*press* event with event.preventDefault() - http://www.jsfiddle.net/6zsGK/
hallvors