setAttributeNode

external fun setAttributeNode(attr: Attr): Attr?(source)

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

MDN Reference