HTMLTemplateElement: shadowRootMode property

Baseline 2024
Newly available

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

The shadowRootMode property of the HTMLTemplateElement interface reflects the value of the shadowrootmode attribute of the associated <template> element.

Note that this property is not useful for developers. If a <template> element is used to declaratively create a ShadowRoot, then this object and property do not exist. Otherwise, if an HTMLTemplateElement is created, the value of this property is irrelevant because the object is not a shadow root and cannot subsequently be changed to a shadow root.

Value

Reflects the value of the shadowrootmode attribute of the associated <template> element.

Specifications

Specification
HTML
# dom-template-shadowrootmode

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
shadowRootMode

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also