diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/element/openorclosedshadowroot | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/element/openorclosedshadowroot')
-rw-r--r-- | files/zh-cn/web/api/element/openorclosedshadowroot/index.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/element/openorclosedshadowroot/index.html b/files/zh-cn/web/api/element/openorclosedshadowroot/index.html new file mode 100644 index 0000000000..145350e232 --- /dev/null +++ b/files/zh-cn/web/api/element/openorclosedshadowroot/index.html @@ -0,0 +1,35 @@ +--- +title: Element.openOrClosedShadowRoot +slug: Web/API/Element/openOrClosedShadowRoot +translation_of: Web/API/Element/openOrClosedShadowRoot +--- +<div>{{APIRef("Shadow DOM")}}{{Draft}}{{non-standard_header}} +<div class="note"><strong>Note:</strong> This API is available only to <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions">WebExtensions</a>.</div> +</div> + +<p><span class="seoSummary"><code>Element.openOrCloseShadowRoot</code> 是一个只读属性。represents the shadow root hosted by the element, regardless if its {{DOMxRef("ShadowRoot.mode", "mode")}} is <code>open</code> or <code>closed</code>.</span> Use {{DOMxRef("Element.attachShadow()")}} to add a shadow root to an existing element.</p> + +<h2 id="Syntax" name="Syntax">Syntax</h2> + +<pre class="syntaxbox notranslate">var <em>shadowroot =</em><em> element</em>.shadowRoot; +</pre> + +<h3 id="Value">Value</h3> + +<p>A {{DOMxRef("ShadowRoot")}} object instance, regardless if its {{DOMxRef("ShadowRoot.mode", "mode")}} is set to <code>open</code> or <code>closed</code>, or <code>null</code> if no shadow root is present. (See {{DOMxRef("Element.attachShadow()")}} for further details).</p> + +<h2 id="Specifications">Specifications</h2> + +<p><em>This property is not part of any specification.</em></p> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.Element.openOrClosedShadowRoot")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li>{{DOMxRef("Element.shadowRoot")}}</li> +</ul> |