aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/shadowroot/innerhtml/index.html
blob: 86b1d0c1f20b7511256700e0885a16a94955753f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: ShadowRoot.innerHTML
slug: Web/API/ShadowRoot/innerHTML
tags:
  - ShadowRoot.innerHTML
translation_of: Web/API/ShadowRoot/innerHTML
---
<p>{{SeeCompatTable}}{{APIRef("Shadow DOM")}}</p>

<p> {{domxref("ShadowRoot")}} 接口的 <strong><code>innerHTML </code></strong>属性设置或返回 ShadowRoot内的DOM树。</p>

<h2 id="句法">句法</h2>

<pre class="syntaxbox">let <em>domString</em> = <em>shadowRoot</em>.innerHTML
// 返回

<em>shadowRoot</em>.innerHTML = <em>domString;</em>

// 设置
</pre>

<h3 id="值"></h3>

<p>一个 {{domxref("DOMString")}}.</p>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Shadow DOM','#widl-ShadowRoot-innerHTML','ShadowRoot.innerHTML')}}</td>
   <td>{{Spec2('Shadow DOM')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

{{Compat("api.ShadowRoot.innerHTML")}}