English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
removeAttributeNode()method to add a newAttrnode object.
If you only want to return the attribute value, please usegetAttribute()method.
UsesetAttribute()The method can add a new attribute or change the value of an existing attribute on the element.
element.removeAttributeNode(attrName)
var elem = document.getElementsByTagName("H")1")[0]; var attr = elem.getAttributeNode("class"); elem.removeAttributeNode(attr);Test See‹/›
All browsers fully support the removeAttributeNode() method:
Method | |||||
removeAttributeNode() | Yes | Yes | Yes | Yes | Yes |
Parameter | Description |
---|---|
attrName | The attribute node you want to delete |
Return Value: | An Attr object representing a deleted attribute node |
---|---|
DOM Version: | DOM Level1 |
HTML Tutorial:HTML Attributes
HTML DOM Reference:HTML DOM Attribute Object
HTML DOM Reference:element.removeAttribute() method
HTML DOM Reference:element.getAttribute() method
HTML DOM Reference:element.setAttribute() method
HTML DOM Reference:element.hasAttribute() method