setAttribute

fun setAttribute(qualifiedName: String, value: String)(source)

Sets the value of element's first attribute whose qualified name is qualifiedName to value.

MDN Reference