.removeAttr( attributeName ) Returns: jQuery

Description: Remove an attribute from each element in the set of matched elements.

  • version added: 1.0.removeAttr( attributeName )

    attributeNameAn attribute to remove.

The .removeAttr() method uses the JavaScript removeAttribute() function, but it has the advantage of being able to be called directly on a jQuery object and it accounts for different attribute naming across browsers.


Clicking the button enables the input next to it.

<!DOCTYPE html>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
<input type="text" disabled="disabled" value="can't edit this" />
$("button").click(function () {
  .val("editable now");