Adds new attribute node attr to element.
The attribute node.
Returns the old node if the attribute has been replaced.
Raised if the node is readonly.