For AI agents: a documentation index is available at the root level at /llms.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo

Set Heading Level

element.setHeadingLevel(level)

Set the heading level of a heading element.

You can also use element.setTag() to change the heading level of a heading element.

Syntax

1element.setHeadingLevel(level: 1 | 2 | 3 | 4 | 5 | 6): Promise<null>

Parameters

  • level: Number - 1 | 2 | 3 | 4 | 5 | 6

Returns

Promise<null>

A Promise that resolves to null

Example

1const selectedElement = await webflow.getSelectedElement()
2
3if (selectedElement?.type === 'Heading'){
4
5 const headingLevel = await selectedElement.setHeadingLevel(1)
6 console.log(headingLevel)
7
8} else {
9 console.log("Selected Element is not a Heading Element")
10}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canEditAnyAnyCanvasAny
Morty Proxy This is a proxified and sanitized view of the page, visit original site.