Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

ShadowRoot: serializable property

Baseline2024
Newly available

Theserializable read-only property of theShadowRoot interface returnstrue if the shadow root is serializable.

If set, the shadow root may be serialized by calling theElement.getHTML() orShadowRoot.getHTML() methods with theoptions.serializableShadowRoots parameter settrue.

The serializable property of a shadow root is specified when the shadow root is created, either declaratively by adding theshadowrootserializable attribute on a<template> element (along with an allowedshadowrootmode value), or by setting theoptions.serializable parameter totrue when usingElement.attachShadow().

Value

true if the shadow root is serializable;false otherwise.

Examples

js
const customElem = document.querySelector("my-shadow-dom-element");const shadow = customElem.shadowRoot;// …// Is it serializable?const hostElem = shadow.serializable;

Specifications

Specification
DOM
# dom-shadowroot-serializable

Browser compatibility

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp