For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
      • Element Presets
      • DOM Elements
        • Get HTML Tag
        • Set HTML Tag
        • Get All Attributes
        • Get Attribute
        • Set Attribute
        • Remove Attribute
      • Strings
      • Components
      • Slots
      • Headings
      • Images
      • Links
      • Forms
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • Methods
  • Properties
ElementsElement Types & Methods

DOM Element

Was this page helpful?
Previous

Get Tag

Next
Built with

The custom element, also known as the DOM Element, is a placeholder element that you can add any HTML custom attribute, tag, or text to — thereby “creating” that element on the canvas. This is useful for adding HTML elements to the canvas that aren’t available as native Webflow elements.

Once you add the custom element to the canvas, you’re able to use the below methods, which are only available to the DOM element, as well as the more general element methods to manage children, styles, and text content.

Methods

The DOM Element supports the following specific methods:

Get HTML Tag

Retrieve the HTML tag of the element.

Set HTML Tag

Set the value of the specified HTML tag of the DOMElement.

Get All Attributes

Retrieve all HTML attributes for the DOMElement.

Get Attribute

Retrieve the value of the named HTML attribute of the DOMElement.

Set Attribute

Set the value of the specified HTML attribute of the DOMElement.

Remove Attribute

Remove the specified HTML attribute from the DOMElement.

Properties

PropertyDescriptionTypeExample
idUnique identifier for the element composed of two identifiers, the component and the element.object{component: "64c813...", element: "5edf8e59-71f9..."}
typeSpecifies the type of the element.string”DOM”
stylesIndicates whether the element can contain styles.booleantrue
childrenIndicates whether an element can contain child elements.booleantrue
textContentIndicates whether an element can contain text content.booleantrue
customAttributesIndicates whether an element can contain custom attributes.booleanfalse