W3cubDocs

/DOM

ShadowRoot.mode

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

The mode read-only property of the ShadowRoot returns the mode (either "open" or "closed") with which a ShadowRoot was created.

When the mode of a shadow root is "closed", the shadow root’s implementation internals are inaccessible and unchangeable from JavaScript—in the same way the implementation internals of, for example, the <video> element are inaccessible and unchangeable from JavaScript.

Syntax

var mode = shadowRoot.mode

Value

Either "open" or "closed".

Specifications

Specification Status Comment
DOM
The definition of 'ShadowRoot.mode' in that specification.
Living Standard

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 53 No support[1] No support[2] No support 40 10
Feature Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 53 No support[1] No support[2] No support 40 10.1

[1] This feature is not implemented yet. See the Edge platform status.

[2] This feature is not implemented yet. See bug 1205323.

© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/mode