setAttributeNS

fun setAttributeNS(namespace: String?, qualifiedName: String, value: String)(source)

Sets the value of element's attribute whose namespace is namespace and local name is localName to value.

MDN Reference