Create Element
Dynamically create and insert new HTML elements into webpages. Use this action to modify page structure, inject custom content, and add interactive components.
Inputs
☐ Prompt / Description (Required)
A clear and concise instruction describing what this step should do. This helps the AI debug and re-insert the element if needed.
Good Example: "Create a new div at the end of the body to display a custom notification."
Bad Example: "Put some new element somewhere on the page."
Why it’s bad? Too vague, lacks specificity about the element type, placement, and purpose.
☐ Element Selector (Required)
Define the target element relative to which the new element will be inserted:
CSS Selector
Use standard CSS selectors to identify the target element.
XPath
Use an XPath expression to precisely locate the target element.
☐ Insert Position (Required)
Choose where to place the new element relative to the target:
-
As last child – Places the new element inside and at the end of the target element
-
As first child – Places the new element inside and at the start of the target element
-
As previous sibling – Places the new element before the target element
-
As next sibling – Places the new element after the target element
-
Replace target element – Removes the target element and puts the new element in its place
☐ Element HTML (Required)
Define the HTML structure of the new element:
☐ Advanced Options (Optional)
- Run Before Page Loaded: Create element before the page fully loads
- Custom Attributes: Add data attributes, IDs, or classes
Usage Example
Notes
- The Prompt / Description is required to help AI debug and adjust the element creation if needed.
- Ensure the selector correctly identifies the target placement.
- When replacing elements, verify that the original element isn’t critical to page functionality.
- Test the created element’s styling and behavior to ensure it integrates properly with the page.