Bypassing the IE "onchange" bug with jQuery

Posted on Oct 20, 2009

Hey all,

I absolutely love jQuery! I use it daily with my client side work, putting the jQuery file into my JS library has become an automated thing I do.

Well, after saying that, even jQuery can’t fix all the IE bugs and quirks. Sometimes you have to bypass them with intelligence and some style

The bug I’m talking about is the one that disables the “onchange” event from firing when the element still has focus.

This phenomenon is absolutely frustrating when you have to react to a checkbox or a radiobutton.

Well, like everything else in jQuery, after scratching my head for a second or two (or 20, or 200) I came up with this solution:

This works like a charm.

Good luck! If you find it useful drop me a line in the comments below…