ShadowRoot: clonable property

The clonable read-only property of the ShadowRoot interface returns true if the shadow root is clonable, and false otherwise. It always returns true for shadow roots created via declarative shadow DOM. It can be set to true using the clonable option of the Element.attachShadow() method.

Examples

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

shadowRoot.clonable;
// true

Specifications

Specification
DOM Standard
# dom-shadowroot-clonable

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
clonable