> For the complete documentation index, see [llms.txt](https://docs.goless.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.goless.com/blocks/web-interaction/create-element-block.md).

# Create Element Block

This block creates an element and inserts it into the webpage.

* **Element selector**\
  The element selector of the specific element.
* **Insert element**\
  Represent the position of the specific element.
  * **As first child**\
    Insert it as the first child of the specific element.
  * **As last child**\
    Insert it as the last child of the specific element.
  * **As previous sibling**\
    Insert it as the previous sibling of the specific element.
  * **As next sibling**\
    Insert it as the next sibling of the specific element.
  * **Replace target element**\
    Substitue the specific element for the element that was created.
* **HTML**\
  The HTML code of the element you would like to create.
* **CSS**\
  The CSS code that will be injected into the webpage
* **JavaScript**\
  The JS that will be injected into the webpage
  * <mark style="color:red;">**`golessRefData(keyword, path?)`**</mark><mark style="color:red;">\*\* \*\*</mark><mark style="color:red;">**function**</mark>\
    Use this function for referencing data.\
    For further information, open the Javascript Block page.
  * <mark style="color:red;">**`golessExecWorkflow(detail)`**</mark><mark style="color:red;">\*\* \*\*</mark><mark style="color:red;">**function**</mark>\
    Workflow execution functionality.\
    The `detail` parameter is where you input the detail of the workflow like the ID or `publicId` of the workflow you want to run.
* **Preload script**\
  Load scripts or styles before injecting the element.

Please note:

This block cannot function without an active tab. For this reason, use the Active Tab block or the New Tab block before using this one.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.goless.com/blocks/web-interaction/create-element-block.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
