2022-08-16 11:58:16 +00:00
|
|
|
---
|
|
|
|
sidebar_label: Frame.focus
|
|
|
|
---
|
|
|
|
|
|
|
|
# Frame.focus() method
|
|
|
|
|
|
|
|
Focuses the first element that matches the `selector`.
|
|
|
|
|
2022-10-24 14:23:24 +00:00
|
|
|
**Signature:**
|
2022-08-16 11:58:16 +00:00
|
|
|
|
|
|
|
```typescript
|
|
|
|
class Frame {
|
|
|
|
focus(selector: string): Promise<void>;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --------- | ------ | -------------------------- |
|
|
|
|
| selector | string | The selector to query for. |
|
|
|
|
|
|
|
|
**Returns:**
|
|
|
|
|
|
|
|
Promise<void>
|
|
|
|
|
|
|
|
## Exceptions
|
|
|
|
|
|
|
|
Throws if there's no element matching `selector`.
|