insertAttribute

The insertAttribute() method adds a attribute to a element

Example

document.querySelector("body").insertAttribute("id","id 1")

Last updated