setAttributeNodeNS method

Attr? setAttributeNodeNS(
  1. Attr attr
)

The setAttributeNodeNS() method of the Element interface adds a new namespaced Attr node to an 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.setAttributeNS method instead.

If you are working with HTML documents and you don't need to specify the requested attribute as being part of a specific namespace, use the Element.setAttribute method instead.

Implementation

external Attr? setAttributeNodeNS(Attr attr);