TOC PREV NEXT INDEX

domref



removeAttributeNode


removeAttributeNode removes the specified attribute from the current element.

Syntax

remove_attr = element.removeAttributeNode(attribute)
 

Parameters

attribute is the Attribute node that needs to be removed.

remove_attr is an Attribute node.

Example

// <div id="top" align="center" />
 
d = document.getElementById("top");
 
d_align = d.getAttributeNode("align");
 
d.removeAttributeNode(d_align);
 
// align has a default value, center,
 
// so the removed attribute is immediately 
 
// replaced: <div id="top" align="center" />
 

Notes

If the removed Attribute has a default value it is immediately replaced. The replacing attribute has the same namespace URI and local name, as well as the original prefix, when applicable.

Specification

removeAttributeNode
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX