> 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 Heading Level

> Retrieves the heading level of a heading element.

## `element.getHeadingLevel()`

Retrieves the heading level of a heading element.

You can also use [`element.getTag()`](/designer/reference/set-tag) to get the heading level of a heading element.

## Syntax

```typescript
element.getHeadingLevel(): Promise<null | 1 | 2 | 3 | 4 | 5 | 6>
```

## Returns

**Promise\<`level`>**: *Number* - 1 | 2 | 3 | 4 | 5 | 6

A Promise that resolves to the value of the heading level.

## Example

```typescript
const selectedElement = await webflow.getSelectedElement()

if (selectedElement?.type === 'Heading'){

  const headingLevel = await selectedElement.getHeadingLevel()
  console.log(headingLevel)

} else {
  console.log("Selected Element is not a Heading Element")
}
```

## Designer Ability

Checks for authorization only

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

```
```