setAttributeNode method

Attr? setAttributeNode(
  1. Attr attr
)

The setAttributeNode() method of the Element interface adds a new Attr node to the specified element.

If you don't need to work with the attribute node (such as cloning from another element) before adding it, you can use the Element.setAttribute method instead.

Implementation

external Attr? setAttributeNode(Attr attr);