Documentation

Plugins/Validation/removeAttrs

From jQuery JavaScript Library

Jump to: navigation, search

« Back to Plugins/Validation

removeAttrs( attributes )

Remove the specified attributes from the first matched element and return them.
Arguments:
attributesString
A space-seperated list of attribute names to remove.

Examples:
Usage of removeAttrs to remove rules, specified via attributes, from an element, submit its form - triggering the form validation - then add those rules back in case the form was invalid and gets a normal submit.

 $("#skip").click(function() {
   var rules = $("#myinput").removeAttrs("min max");
   $("#myform).submit();
   $("#myinput").attr(rules);
 });

NameType