setAttributeNS adds a new attribute or changes the value of an attribute with the given namespace and name.
setAttributeNS
MDN Reference
setAttributeNSadds a new attribute or changes the value of an attribute with the given namespace and name.MDN Reference