Name

removeAttribute( ) — NN n/a IE 4 DOM n/a

Synopsis

removeAttribute(attributeName[, caseSensitivity])

Removes the named attribute from the current element. You may remove only attributes added with the setAttribute( ) method. Removing an attribute does not change the source code when viewed through the browser, but does affect how the browser renders the element.

Returned Value

true if successful; false if the attribute doesn’t exist or its value was not set with setAttribute( ).

Parameters

attributeName

The attribute name used in the HTML tag (not including the =symbol).

caseSensitivity

An optional Boolean value. If true, the attribute in the HTML tag must match the case of the attributeName parameter exactly for its value to be returned.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.