A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/Element/getHTML below:

Element: getHTML() method - Web APIs

Element: getHTML() method

Baseline 2024

Newly available

The getHTML() method of the Element interface is used to serialize an element's DOM to an HTML string.

The method provides an options argument that enables the serialization of child nodes that are shadow roots. The options can be used to include nested shadow roots that have been set as serializable, and/or a specified array of ShadowRoot objects, which may be either open or closed.

Without arguments, child nodes that are shadow roots are not serialized, and this method behaves in the same way as reading the value of Element.innerHTML.

Syntax Parameters
options Optional

An options object with the following optional parameters:

serializableShadowRoots

A boolean value that specifies whether to include serializable shadow roots. The default value is false.

shadowRoots

An array of ShadowRoot objects to serialize. These are included regardless of whether they are marked as serializable, or if they are open or closed. The default value is an empty array.

Return value

A string that represents the HTML serialization of the element.

Exceptions

None.

Specifications Browser compatibility See Also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3