09 February 2011

On change event of select doesn't fire on up / down arrow press

It makes sense that the onchange event is triggered only on unfocus, but it can be useful for the user to trigger this event when a key is pressed.
Example: if you have a second select which is updated when the first one change.


$('select#myselect').bind("change keyup", function(e){
// do something
});