setAttributeNode: newAttr
Sets or replaces the attribute in the Node
interface's attributes
collection with the given
Attr
object. The attribute name
is retrieved from the name attribute of the new attribute object.
If an Attr
object with the
given name already exists in the attributes
collection, this method
returns a reference to the old Attr
object. Otherwise, it returns
null
.
Raised if the newAttr
node was created in a
document different than the parent node.
Raised if the new parent node is read-only.
Raised if another Element
already uses the new
Attr
node. Each element
must have a distinct Attr
object.