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
      • Custom Attributes
        • Get All Custom Attributes
        • Get Custom Attribute
        • Set Custom Attribute
        • Remove Custom Attribute
      • 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.getCustomAttribute(name)
  • Syntax
  • Parameters
  • Returns
  • Example
  • Designer Ability
ElementsElement Properties & MethodsCustom Attributes

Get Custom Attribute

Was this page helpful?
Previous

Set Custom Attribute

Next
Built with

element.getCustomAttribute(name)

Get custom HTML attributes for an element by name.

Syntax

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

Parameters

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

Returns

Promise<String>

A Promise that resolves to the value of the named custom attribute.

Example

1// Get Selected Element
2const selectedElement = await webflow.getSelectedElement()
3
4if (selectedElement?.customAttributes) {
5
6 // Get Custom Attribute by Name
7 const customAttribute = await selectedElement.getCustomAttribute('tooltip')
8 console.log(customAttribute)
9
10}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny