Forked from mathiasbynens/toggleAttr() jQuery plugin
Created
August 17, 2010 16:43
-
-
Save ratbeard/530761 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* toggleAttr() jQuery plugin | |
* @link http://github.com/mathiasbynens/toggleAttr-jQuery-Plugin | |
* @description Used to toggle selected="selected", disabled="disabled", checked="checked" etc… | |
* @author Mathias Bynens <http://mathiasbynens.be/> | |
*/ | |
;(function($) { | |
$.fn.toggleAttr = function(attr) { | |
return this.each(function() { | |
$(this).attr(attr) ? $(this).removeAttr(attr) : $(this).attr(attr, attr); | |
}); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment