Element.openOrClosedShadowRoot

草案: 本页尚未完工.

非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!

Note: This API is available only to WebExtensions.

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

See also