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
        • Search element settings
        • Get settings
        • Get resolved settings
        • Set settings
        • Get visibility
        • Set visibility
        • Get DOM ID
        • Set DOM ID
        • Search bindable sources
      • Attributes
      • Custom Attributes
      • Styles
      • Text Content
      • Display Name
    • Element Types & Methods
  • 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
  • element.getDomId()
  • Syntax
  • Parameters
  • Returns
  • Example
  • Designer Ability
ElementsElement Properties & MethodsSettings

Get DOM ID (Beta)

Was this page helpful?
Previous

Set DOM ID (Beta)

Next
Built with

element.getDomId()

Get the HTML id attribute of an element, or check whether the ID is bound to a data source.

Verify that the element has the domId property before calling this method.

Beta

These methods are in public beta and may change with future releases.

Syntax

1element.getDomId(): Promise<string | null>
2element.getDomId(options: { bindings: true }): Promise<string | BindingValue | null>

Parameters

  • options (optional): { bindings: true } — When passed, returns binding metadata instead of the resolved string value if the ID is bound to a data source.

Returns

  • Promise<string | null>: The current HTML ID as a string, or null if no ID has been set.
  • Promise<string | BindingValue | null> (when { bindings: true } is passed): A BindingValue object if the ID is bound to a data source, or null if no ID has been set.

Example

1const element = await webflow.getSelectedElement();
2
3if (element?.domId) {
4
5 // Get the current DOM ID
6 const id = await element.getDomId();
7 console.log(id); // 'hero-section' or null
8
9 // Read binding metadata
10 const value = await element.getDomId({ bindings: true });
11 // Returns BindingValue when bound, or string when static
12}

Designer Ability

Checks for authorization only.

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny