For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
      • Attributes
        • Get Attributes
        • Get Resolved Attributes
        • Set Attributes
        • Set Attribute
        • Get Attribute Value
        • Get Resolved Attribute Value
        • Remove Attribute
      • Custom Attributes
      • Styles
      • Text Content
      • Display Name
    • Element Types & Methods
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • element.removeAttribute(name) / element.removeAttribute(index)
  • Syntax
  • Parameters
  • Returns
  • Example
  • Designer Ability
ElementsElement Properties & MethodsAttributes

Remove attribute (Beta)

Was this page helpful?
Previous

Custom Attributes

Next
Built with

element.removeAttribute(name) / element.removeAttribute(index)

Remove a single attribute from an element.

You can identify the attribute to remove by its name string or by its zero-based index in the attributes array.

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

Beta

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

Syntax

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

Parameters

  • name : string — The name of the attribute to remove.
  • index : number — The zero-based position of the attribute in the element’s attributes array.

Returns

Promise<null>

A Promise that resolves to null.

Example

1const element = await webflow.getSelectedElement()
2
3if (element && element.attributes) {
4 // Remove by name
5 await element.removeAttribute('data-label')
6
7 // Remove by index
8 await element.removeAttribute(0)
9}

Try this example

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canDesignPrimaryMainCanvasDesign