diff --git a/docs/api/index.md b/docs/api/index.md
index 09fa283fa55..0c301b3e3e3 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -146,6 +146,7 @@ sidebar_label: API
| [Awaitable](./puppeteer.awaitable.md) | |
| [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) | |
| [ConsoleMessageType](./puppeteer.consolemessagetype.md) | The supported types for console messages. |
+| [ElementFor](./puppeteer.elementfor.md) | |
| [ErrorCode](./puppeteer.errorcode.md) | |
| [EvaluateFunc](./puppeteer.evaluatefunc.md) | |
| [EventType](./puppeteer.eventtype.md) | |
diff --git a/docs/api/puppeteer.elementfor.md b/docs/api/puppeteer.elementfor.md
new file mode 100644
index 00000000000..db37a1ec04f
--- /dev/null
+++ b/docs/api/puppeteer.elementfor.md
@@ -0,0 +1,17 @@
+---
+sidebar_label: ElementFor
+---
+
+# ElementFor type
+
+#### Signature:
+
+```typescript
+export declare type ElementFor<
+ TagName extends keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap
+> = TagName extends keyof HTMLElementTagNameMap
+ ? HTMLElementTagNameMap[TagName]
+ : TagName extends keyof SVGElementTagNameMap
+ ? SVGElementTagNameMap[TagName]
+ : never;
+```
diff --git a/docs/api/puppeteer.elementhandle.md b/docs/api/puppeteer.elementhandle.md
index b1f6f25e501..e7663becb28 100644
--- a/docs/api/puppeteer.elementhandle.md
+++ b/docs/api/puppeteer.elementhandle.md
@@ -72,6 +72,7 @@ The constructor for this class is marked as internal. Third-party code should no
| [screenshot(this, options)](./puppeteer.elementhandle.screenshot.md) | | This method scrolls element into view if needed, and then uses [Page.screenshot()](./puppeteer.page.screenshot.md) to take a screenshot of the element. If the element is detached from DOM, the method throws an error. |
| [select(values)](./puppeteer.elementhandle.select.md) | | Triggers a change
and input
event once all the provided options have been selected. If there's no <select>
element matching selector
, the method throws an error. |
| [tap(this)](./puppeteer.elementhandle.tap.md) | | This method scrolls element into view if needed, and then uses [Touchscreen.tap()](./puppeteer.touchscreen.tap.md) to tap in the center of the element. If the element is detached from DOM, the method throws an error. |
+| [toElement(tagName)](./puppeteer.elementhandle.toelement.md) | | Converts the current handle to the given element type. |
| [type(text, options)](./puppeteer.elementhandle.type.md) | |
Focuses the element, and then sends a keydown
, keypress
/input
, and keyup
event for each character in the text.
To press a special key, like Control
or ArrowDown
, use [ElementHandle.press()](./puppeteer.elementhandle.press.md).
elementHandle
to point to an [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). |
| [waitForSelector(selector, options)](./puppeteer.elementhandle.waitforselector.md) | | Wait for an element matching the given selector to appear in the current element.
Unlike [Frame.waitForSelector()](./puppeteer.frame.waitforselector.md), this method does not work across navigations or if the element is detached from DOM.
| diff --git a/docs/api/puppeteer.elementhandle.toelement.md b/docs/api/puppeteer.elementhandle.toelement.md new file mode 100644 index 00000000000..73f2636a968 --- /dev/null +++ b/docs/api/puppeteer.elementhandle.toelement.md @@ -0,0 +1,39 @@ +--- +sidebar_label: ElementHandle.toElement +--- + +# ElementHandle.toElement() method + +Converts the current handle to the given element type. + +#### Signature: + +```typescript +class ElementHandle { + toElement