25.107. Element.setAttributeNode( ): add a new Attr node to an ElementDOM Level 1 Core:25.107.1. SynopsisAttr setAttributeNode(Attr newAttr) tHRows DOMException; 25.107.1.1. Arguments
25.107.1.2. ReturnsThe Attr node that was replaced by newAttr, or null if no attribute was replaced. 25.107.1.3. ThrowsThis method may throw a DOMException with a code of the following values:
25.107.2. DescriptionThis method adds a new Attr node to the set of attributes of an Element node. If an attribute with the same name already exists for the Element, newAttr replaces that attribute, and the replaced Attr node is returned. If no such attribute already exists, this method defines a new attribute for the Element. It is usually easier to use setAttribute( ) instead of setAttributeNode( ). 25.107.3. See AlsoAttr, Document.createAttribute( ), Element.setAttribute( ) |