La propriété en lecture seule HTMLElement.isContentEditable
renvoie un Boolean
qui est true
(vrai) si le contenu de l'élément est éditable ; sinon elle renvoie false
(faux).
Syntaxe
editable = element.isContentEditable
Exemple
JavaScript
document.getElementById("infoText1").innerHTML += document.getElementById("myText1").isContentEditable;
document.getElementById("infoText2").innerHTML += document.getElementById("myText2").isContentEditable;
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>
Résultat
Spécifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard La définition de 'HTMLElement.contenteditable' dans cette spécification. |
Standard évolutif | Pas de changement de la dernière image, HTML 5.1 |
HTML 5.1 La définition de 'HTMLElement.contenteditable' dans cette spécification. |
Recommendation | L'image de HTML Living Standard, n'est pas changée par HTML5 |
HTML5 La définition de 'HTMLElement.contenteditable' dans cette spécification. |
Recommendation | Image de HTML Living Standard, definition initiale. |
Compatibilité des navigateurs
Nous convertissons les données de compatibilité dans un format JSON.
Ce tableau de compatibilité utilise encore l'ancien format
car nous n'avons pas encore converti les données qu'il contient.
Vous pouvez nous aider en contribuant !
Fonctionnalité | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | (Oui) | 4.0 (2) | (Oui) | (Oui) | (Oui) |
Fonctionnalité | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | (Oui) | 4.0 (2) | (Oui) | (Oui) | (Oui) | (Oui) |
Voir aussi
element.contentEditable
- L'attribut global contenteditable.