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
BCD tables only load in the browser