This question is related to my last one about jQuery 1.4. They supposedly fixed the bug causing the change handlers not to work in IE, but it is not fully fixed.
I am trying to bind a live change handler to a select element. Most of the time, when I change it, the event handler fires. But if I tab to the element immediately after the page loads, then try to change the value using the keyboard, then tab away from it, the event doesn't fire in IE. This only happens the first time I try to change the value. I noticed this in IE 6, 7, and 8. It does not happen in any other browsers I tried. I am sure it is a bug in jQuery. Does anyone know a simple way around this?
Here is an example page to demonstrate the bug:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<title>jQuery live change handler test 2</title>
</head>
<body>
<script type="text/javascript" src="jquery-1.4.1.min.js"></script>
<select id="test">
<option value="a">a
<option value="b">b
</select>
<script type="text/javascript">
$("#test").live("change", function() {
alert('hi');
});
</script>
</body></html>