element.removeAttribute(name)

Remove the specified HTML attribute from the DOMElement. Use this method instead of the ‘Custom Attribute’ methods.

Syntax

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

Parameters

  • name : string - The name of the attribute to remove

Returns

Promise<null>

A promise that resolves to null

Example

1// Get Selected Element
2const selectedElement = await webflow.getSelectedElement();
3
4if (selectedElement?.type === "DOM") {
5 // Get current attributes
6 const beforeAttributes = await selectedElement.getAllAttributes();
7 console.log('Before removal:', beforeAttributes);
8
9 // Remove an attribute
10 await selectedElement.removeAttribute('width');
11
12 // Get attributes after removal to verify
13 const afterAttributes = await selectedElement.getAllAttributes();
14 console.log('After removal:', afterAttributes);
15}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canDesignPrimaryMainCanvasDesign
Built with