element.getAllAttributes()

Retrieve all HTML attributes for the DOMElement. Use this method instead of the ‘Custom Attribute’ methods.

Syntax

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

Returns

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

A promise that resolves to an array of, NamedValue attribute objects.

Example

1// Get Selected Element
2const selectedElement = await webflow.getSelectedElement();
3
4if (selectedElement?.type === "DOM") {
5
6 const customAttributes = await selectedElement.getAllAttributes()
7 console.log(customAttributes)
8}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny
Built with