Remove Custom Attribute

element.removeCustomAttribute(name)

Remove an attribute from an element.

Previously, this method removed only custom HTML attributes on an element, but now it can remove any attribute.

This method is equivalent to the element.removeAttribute(name) method.

Syntax

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

Parameters

  • name : String - The name of the custom attribute.

Returns

Promise<null>

A Promise that resolves to null

Example

1// Get Selected Element
2const selectedElement = await webflow.getSelectedElement()
3
4if (selectedElement?.customAttributes) {
5
6 // Remove Custom Attribute
7 await selectedElement.removeCustomAttribute("tooltip")
8
9}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canDesignPrimaryMainCanvasDesign