element.getAllCustomAttributes()

Get all custom HTML attributes from an element.

Syntax

1element.getAllCustomAttributes():Promise<Array<NamedValue>>

Returns

Promise<Array<NamedValue>> - [{name: string, value: string}]

A Promise that resolves to an array of NamedValue custom attribute objects.

Example

1// Get Selected Element
2const selectedElement = await webflow.getSelectedElement()
3
4if (selectedElement?.customAttributes) {
5
6 // Get All Custom Attributes
7 const customAttributes = await selectedElement.getAllCustomAttributes()
8 console.log(customAttributes)
9
10}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny
Built with