The removeAttr method
The removeAttr method removes attributes from elements.
Syntax
$(selector).removeAttr(attribute name);
Example
Let's remove the value attribute from the input:
<input type="text" value="!!!" id="test">
$('#test').removeAttr('value');
HTML the code will look like this:
<input type="text" id="test">
See also
-
method
attr,
which allows you to get and change attributes of elements -
method
prop,
which allows you to work with the properties of elements -
method
removeProp,
which allows you to delete properties of elements