# Element.getAttributes

Read fresh element attributes.

```js
element.getAttributes()
```

## Arguments

No arguments.

## Returns

Object containing identifier, type, className, label, text, value, rect and state flags.

## Example

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

## Notes

Stale elements throw; reacquire after navigation. Read several fields with getAttributes() in one call.

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