Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. ShadowRoot
  4. clonable

ShadowRoot: clonable property

Baseline 2024
Newly available

Since April 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

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-2026 Movatter.jp