# Element.waitForGone

Wait until no element matches. Scoped to descendants.

```js
element.waitForGone(selector, optionsOrTimeout?)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `selector` | object \| string | Attribute filters; a string means {name: string}. See the UIHelper guide for selectors. |
| `optionsOrTimeout` | object \| number | Optional milliseconds, or {timeout:5000, interval:100, throwOnTimeout:true}. Interval is at least 10 ms. |

## Returns

true; throws TimeoutError on timeout, or false with throwOnTimeout:false.

## Example

```js
const panel = UIHelper.waitForElement({id: "panel"}, 5000);
panel.waitForGone({id: "loading", visible: true}, 10000);
```

## Notes

The parent must still be valid. See the matching UIHelper method for options. Placeholder panel/child identifiers require inspection.

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