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