# Element.getAttribute

Read one named fresh attribute.

```js
element.getAttribute(name)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `name` | string | Attribute name such as identifier, label, visible or rect. |

## Returns

Attribute value; unknown names throw.

## Example

```js
const element = UIHelper.waitForElement({id: "target", visible: true, enabled: true}, 5000);
console.log(element.getAttribute("identifier"));
```

[All JavaScript APIs](https://mcp.applesauceos.com/doc/api.md) · [Automation playbook](https://mcp.applesauceos.com/doc/ai.md)
