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
  • Methods
ElementsElement Properties & Methods

Attributes (beta)

Was this page helpful?
Previous

Get attributes (Beta)

Next
Built with

These methods let you read and write attributes on elements using array-based access and binding support. Both attribute names and values can be plain strings or BindingValue references bound to variables or component props. These methods can write both standard HTML attributes and custom attributes.

To use the methods below, choose an element with a CustomAttributes property of true. Using these methods with elements that don’t have this property will return an error.

To use the methods below, choose an element with a attributes property of true Using these methods with elements that don’t have this property returns an error.

Beta

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

Methods

Get Attributes

Get all attributes as an array of name/value pairs, including binding references.

Get Resolved Attributes

Get all attributes with bindings resolved to their current values.

Set Attributes

Replace all attributes on an element with a provided array of attribute names and values.

Set Attribute

Set a single attribute by name or index.

Get Attribute Value

Get the value of a single attribute by name or index.

Get Resolved Attribute Value

Get the resolved value of a single attribute by name.

Remove Attribute

Remove a single attribute by name or index.