For the complete documentation index, see llms.txt. This page is also available as Markdown.

insertAttribute

The insertAttribute() method adds a attribute to a element

Example

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

Last updated