Element.openOrCloseShadowRoot
是一个只读属性。represents the shadow root hosted by the element, regardless if its mode
is open
or closed
. Use Element.attachShadow()
to add a shadow root to an existing element.
Syntax
var shadowroot = element.shadowRoot;
Value
A ShadowRoot
object instance, regardless if its mode
is set to open
or closed
, or null
if no shadow root is present. (See Element.attachShadow()
for further details).
Specifications
This property is not part of any specification.
Browser compatibility
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.