HTMLElement: isContentEditable-Eigenschaft
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Die schreibgeschützte Eigenschaft HTMLElement.isContentEditable
gibt einen booleschen Wert zurück, der true
ist, wenn der Inhalt des Elements bearbeitbar ist; andernfalls wird false
zurückgegeben.
Wert
Ein boolescher Wert.
Beispiele
HTML
html
<p id="firstParagraph">Uneditable Paragraph</p>
<p id="secondParagraph" contenteditable="true">Editable Paragraph</p>
<p id="infoText1">Is the first paragraph editable?</p>
<p id="infoText2">Is the second paragraph editable?</p>
JavaScript
js
const firstParagraph = document.getElementById("firstParagraph");
const secondParagraph = document.getElementById("secondParagraph");
const infoText1 = document.getElementById("infoText1");
const infoText2 = document.getElementById("infoText2");
infoText1.textContent += " " + firstParagraph.isContentEditable;
infoText2.textContent += " " + secondParagraph.isContentEditable;
Ergebnis
Spezifikationen
Specification |
---|
HTML # dom-iscontenteditable-dev |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
isContentEditable |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Siehe auch
HTMLElement/contentEditable
- Das globale Attribut
contenteditable
.