The removeAttr method
The removeAttr method removes attributes from elements.
Syntax
javascript$(selector).removeAttr(attribute name);
Example
Let's remove the value attribute from the input:
html<input type="text" value="!!!" id="test">javascript$('#test').removeAttr('value');
HTML the code will look like this:
html<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