Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $.fn.enable = function() {
- // Enable each selected element by removing its 'disabled' attribute.
- return this.each(function() {
- $(this).removeAttr('disabled');
- });
- };
- $.fn.disable = function() {
- return this.each(function() {
- // Disable each selected element that is a form control by setting
- // its 'disabled' attribute.
- if ($(this).is(':input')) {
- $(this).attr('disabled', 'disabled');
- }
- });
- };
- })(jQuery);
Add Comment
Please, Sign In to add comment