blob: dd7c70499878f24ce150edc8cf221d7d1cc53b51 (
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
---
title: HTMLElement.isContentEditable
slug: Web/API/HTMLElement/isContentEditable
tags:
- HTML DOM
- Propriété
- Reference
- lecture seule
- Édition
- Élément HTML
translation_of: Web/API/HTMLElement/isContentEditable
---
<div>
<div>{{ APIRef("HTML DOM") }}</div>
</div>
<p>La propriété en lecture seule <strong><code>HTMLElement.isContentEditable</code></strong> renvoie un {{jsxref("Boolean")}} qui est <code>true </code><em>(vrai)</em> si le contenu de l'élément est éditable ; sinon elle renvoie <code>false</code><em>(faux)</em>.</p>
<h2 id="Syntax">Syntaxe</h2>
<pre class="syntaxbox"><em>editable</em> = <em>element</em>.isContentEditable
</pre>
<h2 id="Exemple">Exemple</h2>
<h3 id="JavaScript">JavaScript</h3>
<pre class="brush: js">document.getElementById("infoText1").innerHTML += document.getElementById("myText1").isContentEditable;
document.getElementById("infoText2").innerHTML += document.getElementById("myText2").isContentEditable;</pre>
<h3 id="HTML">HTML</h3>
<pre class="brush: html"><p id="myText1">Uneditable Paragraph</p>
<p id="myText2" contentEditable="true">Editable Paragraph</p>
<p id="infoText1">Can edit the first paragraph? </p>
<p id="infoText2">Can edit the second paragraph? </p></pre>
<h3 id="Résultat">Résultat</h3>
<p>{{ EmbedLiveSample('Example') }}</p>
<h2 id="Spécifications">Spécifications</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('HTML WHATWG', "editing.html#dom-iscontenteditable", "HTMLElement.contenteditable")}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>Pas de changement de la dernière image, {{SpecName('HTML5.1')}}</td>
</tr>
<tr>
<td>{{SpecName('HTML5.1', "editing.html#dom-iscontenteditable", "HTMLElement.contenteditable")}}</td>
<td>{{Spec2('HTML5.1')}}</td>
<td>L'image de {{SpecName('HTML WHATWG')}}, n'est pas changée par {{SpecName('HTML5 W3C')}}</td>
</tr>
<tr>
<td>{{SpecName('HTML5 W3C', "editing.html#dom-iscontenteditable", "HTMLElement.contenteditable")}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td>Image de {{SpecName('HTML WHATWG')}}, definition initiale.</td>
</tr>
</tbody>
</table>
<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
<p>{{Compat("api.HTMLElement.isContentEditable")}}</p>
<h2 id="Voir_aussi">Voir aussi</h2>
<ul>
<li>{{domxref("element.contentEditable")}}</li>
<li>L'attribut global <a href="/en-US/docs/Web/HTML/Global_attributes/contenteditable">contenteditable</a>.</li>
</ul>
|