setAttributeNS

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

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 setAttribute() method instead.

MDN Reference