aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/htmlelement/contenteditable/index.html
blob: 38cb71dfbc799ba9ab708b4724a9a7a47dcf83b6 (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
60
61
62
---
title: HTMLElement.contentEditable
slug: Web/API/HTMLElement/contentEditable
translation_of: Web/API/HTMLElement/contentEditable
---
<div>
<div>{{ APIRef("HTML DOM") }}</div>
</div>

<p>Свойство <strong><code>HTMLElement.contentEditable</code></strong> элемента - признак, указывающий можно или нет редактировать содержимое элемента. Свойство может принимать следующие значения:</p>

<ul>
 <li><code>true или пустая строка - содержимое элемента доступно для редактирования</code>.</li>
 <li><code>false</code> - содержимое элемента не доступно для редактирования.</li>
 <li><code>inherit</code> - наследуется значение данного свойства от родительского элемента.</li>
</ul>

<p>Вы можете использовать свойство {{domxref("HTMLElement.isContentEditable")}}, чтобы проверить {{domxref("Boolean")}} значение этого свойства.</p>

<h2 id="Syntax">Синтаксис</h2>

<pre class="syntaxbox"><em>editable</em> = element.contentEditable
element.contentEditable = "true"
</pre>

<h2 id="Specifications">Спецификации</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'interaction.html#contenteditable', 'contenteditable')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.HTMLElement.contentEditable")}}</p>

<p>In Internet Explorer, <code>contenteditable</code> cannot be applied to the
    {{htmlelement("table")}}, {{htmlelement("col")}}, {{htmlelement("colgroup")}},
    {{htmlelement("tbody")}}, {{htmlelement("td")}}, {{htmlelement("tfoot")}},
    {{htmlelement("th")}}, {{htmlelement("thead")}}, and {{htmlelement("tr")}} elements
    directly. A content editable {{htmlelement("span")}} or {{htmlelement("div")}} element
    can be placed inside the individual table cells.</p>
  
<h2 id="See_also">See also</h2>

<ul>
 <li>{{domxref("HTMLElement.isContentEditable")}}</li>
 <li>The <a href="/en-US/docs/Web/HTML/Global_attributes/contenteditable">contenteditable</a> global attribute.</li>
 <li><a href="https://medium.com/medium-eng/why-contenteditable-is-terrible-122d8a40e480">Why ContentEditable is Terrible, Or: How the Medium Editor Works</a></li>
</ul>