The insertAttribute() method adds a attribute to a element
insertAttribute()
Example
document.querySelector("body").insertAttribute("id","id 1")
Last updated 1 year ago
Was this helpful?