Skip to content

Instantly share code, notes, and snippets.

@Crisfole
Created July 24, 2012 15:46
Show Gist options
  • Save Crisfole/3170787 to your computer and use it in GitHub Desktop.
Save Crisfole/3170787 to your computer and use it in GitHub Desktop.
Add sorely lacking disable() and enable() functions to jQuery
(function ($) {
$.fn.disable = function () {
return this.each(function () {
$(this).attr("disabled", "disabled");
});
}
$.fn.enable = function () {
return this.each(function () {
$(this).removeAttr("disabled");
});
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment