Created
September 17, 2013 06:38
-
-
Save gorosz/6590763 to your computer and use it in GitHub Desktop.
[javascript] - Toggle_attribute
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
<script> | |
(function($) { | |
$.fn.toggleReadonly = function() { | |
return this.each(function() { | |
var $this = $(this); | |
if ($this.attr('readonly')) $this.removeAttr('readonly'); | |
else $this.attr('readonly', 'readonly'); | |
}); | |
}; | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment