Back to Puppeteer

ElementHandle.click() method

docs/api/puppeteer.elementhandle.click.md

19.2.2805 B
Original Source

ElementHandle.click() method

This method scrolls element into view if needed, and then uses Page.mouse to click in the center of the element. If the element is detached from DOM, the method throws an error.

Signature

typescript
class ElementHandle {
  click(
    this: ElementHandle<Element>,
    options?: Readonly<ClickOptions>,
  ): Promise<void>;
}

Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

this

</td><td>

ElementHandle<Element>

</td><td> </td></tr> <tr><td>

options

</td><td>

Readonly<ClickOptions>

</td><td>

(Optional)

</td></tr> </tbody></table>

Returns:

Promise<void>