[jQuery] Keyup differences among browsers
While investigating the various key events, I've run into some
interesting findings. I wanted to post them here to have others
confirm/deny my findings.
First off, I was working with the TAB key (keyCode: 9) and found out
quickly that IE does not fire the keypress event for the TAB key. PPK
has a good <a href='http://www.quirksmode.org/js/keys.html'>resource
page</a> about detecting keystrokes.
Once I switched to using keyup, all of the browsers I was testing with
fired on TAB, but with differing results:
<a href='http://www.ericmmartin.com/code/jquery/keyup.html'>http://
www.ericmmartin.com/code/jquery/keyup.html</a>
The results:
- Firefox 2 & 3: results mostly as expected. after 1 cycle, the tab
back into the content selects the body and returns an undefined
target, but still triggers a keyup event
- IE7 & 6: results not as expected. initial tab to the first element,
in this case the "text" input, does not trigger a keyup event
- Safari 2: results as expected
- Opera 9: results mostly as expected. unlike all other browsers,
tabbing does not cycle through the browser controls, only through the
elements on the page
I thought it was interesting how each of the browsers handled tabbing
differently. The lack of a keyup event in IE is frustrating...anyone
know of a workaround?