# Element.setText

Replace the value of a supported UIKit text field/view.

```js
element.setText(text)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `text` | string | Replacement text. |

## Returns

The same element.

## Example

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

## Notes

Custom controls may require typeText or physical input. Verify the value.

## Also available as

`Element.setValue`.

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