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/ShadowRoot/serializable below:

ShadowRoot: serializable property - Web APIs

ShadowRoot: serializable property

Baseline 2024

Newly available

The serializable read-only property of the ShadowRoot interface returns true if the shadow root is serializable.

If set, the shadow root may be serialized by calling the Element.getHTML() or ShadowRoot.getHTML() methods with the options.serializableShadowRoots parameter set true.

The serializable property of a shadow root is specified when the shadow root is created, either declaratively by adding the shadowrootserializable attribute on a <template> element (along with an allowed shadowrootmode value), or by setting the options.serializable parameter to true when using Element.attachShadow().

Value

true if the shadow root is serializable; false otherwise.

Examples
const customElem = document.querySelector("my-shadow-dom-element");
const shadow = customElem.shadowRoot;

// …

// Is it serializable?
const hostElem = shadow.serializable;
Specifications Browser compatibility

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