Search code examples
javascriptformsinternet-explorereventsbrowser-feature-detection

Browser detection - checkbox change events


I'm creating a form with some fancy interactivity which depends on the change event of radio buttons. As ie doesn't trigger this event until another element is focused I need to branch my code, but want to go down the feature detection rather than browser detection route.

Looking at a few resources (http://api.jquery.com/jQuery.support/, http://kangax.github.com/cft/) I can't find any implementation of detecting ie's buggy radio/checkbox change events.

Does anyone know how I might be able to detect it?


Solution

  • In my experience, click and keyup are the only event to trust in this case.

    (function () {
      $('#yourRadio').bind('click keyup', function () {
        // check value with $(this).val()
      });
    }());