> 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 HTML tag

## `element.getTag()`

Retrieve the HTML tag of an element.

### Syntax

```typescript
element.getTag(): Promise<null | BlockElementTag | HeadingTag | ListTag | string>
```

This method also returns the binding metadata for Heading elements:

```typescript
// Heading elements only — returns binding metadata when tag is bound to a CMS field
element.getTag(options: { bindings: true }): Promise<HeadingTag | BindingValue | null>
```

### Returns

The return type depends on the element type:

| Element type                                                                                                                               | Return type               | Valid tag values                                                                             |
| :----------------------------------------------------------------------------------------------------------------------------------------- | :------------------------ | :------------------------------------------------------------------------------------------- |
| `Block`, `Section`, `VFlex`, `HFlex`, `Container`, `Row`, `Column`, `BlockContainer`, `RichText`, `Slot`, `NavbarContainer`, `TabsContent` | `BlockElementTag \| null` | `div`, `header`, `footer`, `nav`, `main`, `section`, `article`, `aside`, `address`, `figure` |
| `Heading`                                                                                                                                  | `HeadingTag \| null`      | `h1`, `h2`, `h3`, `h4`, `h5`, `h6`                                                           |
| `List`                                                                                                                                     | `ListTag \| null`         | `ul`, `ol`                                                                                   |
| `DOM`                                                                                                                                      | `string \| null`          | Any valid custom tag name                                                                    |

Returns `null` if the element is not found or the tag is not set.

> **The element type doesn't tell you the HTML tag**
>
> [Box](/designer/reference/element-presets) elements have the element type `Block`, the same type as a Div Block.
> A `Block` element can use any of the tags in the table above, so check `element.type` to narrow the type, then call `getTag()` to read the tag.
> Other layout types, such as `Section`, `Container`, `Row`, and `VFlex`, can still appear in existing content.
> The deprecated `Grid`, `Row`, `HFlex`, `VFlex`, and `BlockContainer` presets also still create elements of their own types.
> `Grid` elements don't have a `getTag()` method.

### Example

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

if (el?.type === 'Block') {
  const tag = await el.getTag(); // BlockElementTag | null
  console.log(tag); // e.g. 'section'
}

if (el?.type === 'Heading') {
  const tag = await el.getTag(); // HeadingTag | null
  console.log(tag); // e.g. 'h2'
}

if (el?.type === 'List') {
  const tag = await el.getTag(); // ListTag | null
  console.log(tag); // 'ul' or 'ol'
}
```

### Designer Ability

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