Tip: Click lines to highlight, hold ctrl/cmd to multi-select

radioChange (10-Sep @ 16:12)

Works both with checkboxes and radio buttons.

remy

Syntax Highlighted Code

  1. $.fn.radioChange = function (fn) {
  2.   return this.each(function () {
  3.     if (!$.browser.msie) {
  4.       $(this).change(fn);
  5.     } else {
  6.       $(this).click(fn);
  7.     }
  8.   });
  9. };
  10.  
  11.  

Plain Code

$.fn.radioChange = function (fn) { 
  return this.each(function () {
    if (!$.browser.msie) {
      $(this).change(fn);
    } else {
      $(this).click(fn);
    }
  });
};

Permalink: http://codedumper.com/radiochange