> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Get DOM ID (Beta)

> Get the HTML ID of an element.

## `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

```typescript
element.getDomId(): Promise<string | null>
element.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

```typescript
const element = await webflow.getSelectedElement();

if (element?.domId) {

  // Get the current DOM ID
  const id = await element.getDomId();
  console.log(id); // 'hero-section' or null

  // Read binding metadata
  const value = await element.getDomId({ bindings: true });
  // Returns BindingValue when bound, or string when static
}
```

## Designer Ability

Checks for authorization only.

| Designer Ability    | Locale | Branch | Workflow | Sitemode |
| :------------------ | :----- | :----- | :------- | :------- |
| **canAccessCanvas** | Any    | Any    | Any      | Any      |