From http://jquery14.com/day-01/jquery-14
normalize change and submit events (change documentation, send documentation)
The work of modifying and sending events reliably in browsers for both normal and live events. We override the normal change and dispatch of events in Internet Explorer and replace them with events that work the same way with other browsers.
OK, this seems like an error, either in IE or in jQuery.
What causes the problem, the selected = "selected" attribute in the option causes the change event to fire before any mouse event occurs. I assume this is a weird / bug with IE, as it seems that it does not set the selected UNTIL element, this is visible, thereby causing a change even for the initial drop-down list. I am talking about an error in IE because if I call window.event.cancelBubble the event handler does not fire at all.
This is really weird.
The workaround is to remove the selected attribute.
ScottKoon
source share