> For the complete documentation index, see [llms.txt](https://docs.novarietygames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.novarietygames.com/websitecreator/luascript/dom/elements/insertattribute.md).

# insertAttribute

The **`insertAttribute()`** method adds a attribute to a element

**Example**

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