> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Get attribute value (Beta)

> Get the value of a single attribute on an element by name or index.

## `element.getAttributeValue(name)` / `element.getAttributeValue(index)`

Get the value of a single attribute on an element.

You can look up the attribute by its name string or by its zero-based index in the attributes array.
The returned value may be a plain string or a `BindingValue` when the attribute value is bound to a variable or component prop.

To get the resolved string value with any binding evaluated, use [`element.getResolvedAttributeValue()`](/designer/reference/attributes/getResolvedAttributeValue).

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

### Syntax

```typescript
element.getAttributeValue(name: string): Promise<string | BindingValue | null>
element.getAttributeValue(index: number): Promise<string | BindingValue | null>
```

### Parameters

* **`name`** : *string* — The name of the attribute whose value to retrieve.
* **`index`** : *number* — The zero-based position of the attribute in the element's attributes array.

### Returns

**Promise\<string | *BindingValue* | null>**

A Promise that resolves to the attribute value, a `BindingValue` if the value is a binding reference, or `null` if no attribute with the given name or index exists.

### Example

```typescript
const element = await webflow.getSelectedElement()

if (element && element.attributes) {
  // Look up by name
  const value = await element.getAttributeValue('data-label')
  console.log(value) // 'primary'

  // Look up by index
  const first = await element.getAttributeValue(0)
  console.log(first) // 'primary'
}
```

[Try this example](https://webflow.com/oauth/authorize?response_type=code\&client_id=19511de1ec410f9228d8dcbc9420e67916dea80d86d18f0c9a533eb475ea0f62)

### Designer Ability

Checks for authorization only.

| Designer Ability    | Locale | Branch | Workflow | Sitemode |
| :------------------ | :----- | :----- | :------- | :------- |
| **canAccessCanvas** | Any    | Any    | Any      | Any      |