Element: setAttribute () method - Web APIs | MDN
6 days ago · The setAttribute() method of the Element interface sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with t...