createAttributeNS

fun createAttributeNS(namespace: String?, qualifiedName: String): Attr(source)

The Document.createAttributeNS() method creates a new attribute node with the specified namespace URI and qualified name, and returns it.

MDN Reference