blob: 7195d49a90a6d984996b046083a4b04dcaee3518 (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
---
title: HTMLElement.isContentEditable
slug: Web/API/HTMLElement/isContentEditable
translation_of: Web/API/HTMLElement/isContentEditable
---
<div>
<div>
<div>{{ APIRef("HTML DOM") }}</div>
</div>
</div>
<h2 id="Summary" name="Summary">概述</h2>
<p> <strong><code>HTMLElement.isContentEditable</code></strong> 只读属性返回一个{{jsxref("Boolean", "布尔值")}}:如果当前元素的内容为可编辑状态,则返回 <code>true</code>,否则返回 <code>false</code>。</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><em>editable</em> = element.isContentEditable
</pre>
<h2 id="规范" style="margin-bottom: 20px; font-size: 2.14285714285714rem;">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">规范版本</th>
<th scope="col">规范状态</th>
<th scope="col">备注</th>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG', "editing.html#dom-iscontenteditable", "HTMLElement.contenteditable")}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>No change from latest snapshot, {{SpecName('HTML5.1')}}</td>
</tr>
<tr>
<td>{{SpecName('HTML5.1', "editing.html#dom-iscontenteditable", "HTMLElement.contenteditable")}}</td>
<td>{{Spec2('HTML5.1')}}</td>
<td>Snapshot of {{SpecName('HTML WHATWG')}}, no change from {{SpecName('HTML5 W3C')}}</td>
</tr>
<tr>
<td>{{SpecName('HTML5 W3C', "editing.html#dom-iscontenteditable", "HTMLElement.contenteditable")}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td>Snapshot of {{SpecName('HTML WHATWG')}}, initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性" style="margin-bottom: 20px; font-size: 2.14285714285714rem;">浏览器兼容性</h2>
{{Compat("api.HTMLElement.isContentEditable")}}
<h2 id="相关链接" style="margin-bottom: 20px; font-size: 2.14285714285714rem;">相关链接</h2>
<ul>
<li>{{domxref("HTMLElement.contentEditable")}}</li>
<li>全局属性 <a href="https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes/contenteditable">contenteditable</a></li>
</ul>
<p id="Notes"> </p>
|