setAttribute

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

The setAttribute() method of the Element interface sets the value of an attribute on the specified element.

MDN Reference