I'm trying to get selectbox to behave like a normal html selectbox. What I want is when you press a key it will jump down to the next option that starts with that letter, however, in IE while the select box is open, im unable to detect the keypress:
$(document).ready(function(){
$('select').selectbox();
$(document).keypress(function(){
alert('working');
});
});
The jfiddle works in chrome and firefox but not IE9.
I've had similar problems using keydown. Delegate may be a solution but I'm not sure how it works.
Is there a way to detect a keypress in IE while the dropdown is open?
Yes, keyup works.
$(document).keyup(function(){
alert('working');
});
As a side note, keyup is generally the best way to register keypress events, unless you are specifically looking for multiple-key combinations.