Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

ShadowRoot: clonable property

Baseline2024
Newly available

Theclonable read-only property of theShadowRoot interface returnstrue if the shadow root is clonable, andfalse otherwise.

When the value istrue, a shadow host cloned withNode.cloneNode() orDocument.importNode() will include a copy of the shadow root.

By default the value isfalse.It can be set totrue using theclonable option of theElement.attachShadow() method or by setting theshadowrootclonable attribute of the<template> element that is being used to declaratively attach a shadow root.

Value

true if the shadow root is clonable, andfalse otherwise.

Examples

js
const host = document.createElement("div");const shadowRoot = host.attachShadow({  mode: "open",  clonable: true,});shadowRoot.clonable;// true

Specifications

Specification
DOM
# dom-shadowroot-clonable

Browser compatibility

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp