> 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 Custom Attribute

## `element.getCustomAttribute(name)`

Get [custom HTML attributes](https://help.webflow.com/hc/en-us/articles/33961389460115) for an element by name.

### Syntax

```typescript
element.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

```typescript
// Get Selected Element
const selectedElement = await webflow.getSelectedElement()

if (selectedElement?.customAttributes) {

  // Get Custom Attribute by Name
  const customAttribute = await selectedElement.getCustomAttribute('tooltip')
  console.log(customAttribute)

}
```

### Designer Ability

Checks for authorization only

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