component.getRootElement()

Retrieves the root element of the component.

Syntax

1webflow. getRootElement(): Promise<null | AnyElement>;

Returns

Promise< AnyElement>

A Promise that resolves to the root element.

Example

1// Get Component
2const all = await webflow.getAllComponents()
3const firstComponent = all[0]
4
5// Get Root Element of Component
6const root = await firstComponent?.getRootElement()
7console.log(root)

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyany