> 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.md).

# Elements

An **element** is a part of a webpage. In [XML](https://developer.mozilla.org/en-US/docs/Glossary/XML) and [HTML](https://developer.mozilla.org/en-US/docs/Glossary/HTML), an element may contain a data item or a chunk of text or an image, or perhaps nothing. A typical element includes an opening tag with some [attributes](https://developer.mozilla.org/en-US/docs/Glossary/Attribute), enclosed text content, and a closing tag.

<img src="https://developer.mozilla.org/en-US/docs/Glossary/Element/anatomy-of-an-html-element.png" alt="Example: in <p class=&#x22;nice&#x22;>Hello world!</p>, &#x27;<p class=&#x22;nice&#x22;>&#x27; is an opening tag, &#x27;class=&#x22;nice&#x22;&#x27; is an attribute and its value, &#x27;Hello world!&#x27; is enclosed text content, and &#x27;</p>&#x27; is a closing tag." height="181" width="609">

Elements and [tags](https://developer.mozilla.org/en-US/docs/Glossary/Tag) are *not* the same things. Tags begin or end an element in source code, whereas elements are part of the [DOM](https://developer.mozilla.org/en-US/docs/Glossary/DOM), the document model for displaying the page in the [browser](https://developer.mozilla.org/en-US/docs/Glossary/Browser).

<table><thead><tr><th>Functions</th><th>Documentation</th><th data-hidden></th></tr></thead><tbody><tr><td>getElementById</td><td><a data-mention href="/pages/UUrQwkWwSbXWif60jOFr">/pages/UUrQwkWwSbXWif60jOFr</a></td><td></td></tr><tr><td>getElementsById</td><td><a data-mention href="/pages/fzyka9fImsjaPBZy6m1S">/pages/fzyka9fImsjaPBZy6m1S</a></td><td></td></tr><tr><td>querySelector</td><td><a data-mention href="/pages/lLi0F4QhRRqbBaNK4NGI">/pages/lLi0F4QhRRqbBaNK4NGI</a></td><td></td></tr><tr><td>querySelectorAll</td><td><a data-mention href="/pages/a4cWmyaaRQW714LvUdXs">/pages/a4cWmyaaRQW714LvUdXs</a></td><td></td></tr><tr><td>appendChild</td><td><a data-mention href="/pages/FxnUgP7HhhjD3oD7dyzX">/pages/FxnUgP7HhhjD3oD7dyzX</a></td><td></td></tr><tr><td>insertBefore</td><td><a data-mention href="/pages/wnykw2QDpqW5C1pXVL3K">/pages/wnykw2QDpqW5C1pXVL3K</a></td><td></td></tr><tr><td>removeChild</td><td><a data-mention href="/pages/qIQTFd7XEvqI3JbpL7uJ">/pages/qIQTFd7XEvqI3JbpL7uJ</a></td><td></td></tr><tr><td>insertAttribute</td><td><a data-mention href="/pages/MTjtbDckztqgJNEacTMK">/pages/MTjtbDckztqgJNEacTMK</a></td><td></td></tr><tr><td>removeAttribute</td><td><a data-mention href="/pages/wEyDLe76pZIncULmXoZp">/pages/wEyDLe76pZIncULmXoZp</a></td><td></td></tr><tr><td>cloneNode</td><td><a data-mention href="/pages/j9Zsq4rRBSuldkHMdpT9">/pages/j9Zsq4rRBSuldkHMdpT9</a></td><td></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.novarietygames.com/websitecreator/luascript/dom/elements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
