Element.setAttributeNode() (Method)

A new attribute node is added to the element. If one with the same name already exists, it will be replaced.

Availability:

DOM level - 1
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
Property/method value type:Attribute object
JavaScript syntax:-myElement.setAttributeNode(anAttribute)
Argument list:anAttributeAn attribute node object to be set

See also:Attribute object