Get resolved attribute value (Beta)

element.getResolvedAttributeValue(name)

Get the resolved value of a single attribute on an element.

This method returns the final output value for the named attribute. If the attribute value is bound to a variable or component prop, the binding is resolved to its current string value rather than returned as a binding reference.

To get the raw value including any binding reference, use element.getAttributeValue().

Beta

These methods are in public beta and may change with future releases.

Syntax

1element.getResolvedAttributeValue(name: string): Promise<string | null>

Parameters

  • name : string — The name of the attribute whose resolved value to retrieve.

Returns

Promise<string | null>

A Promise that resolves to the attribute’s current string value, or null if no attribute with the given name exists.

Example

1const element = await webflow.getSelectedElement()
2
3if (element && element.attributes) {
4 const value = await element.getResolvedAttributeValue('data-title')
5 console.log(value) // 'My heading'
6}

Designer Ability

Checks for authorization only.

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny