createAttribute

fun createAttribute(localName: String): Attr(source)

The Document.createAttribute() method creates a new attribute node, and returns it.

MDN Reference