Javascript examples for DOM:Element isContentEditable
The isContentEditable property returns whether the content of an element is editable.
This property is read-only.
A Boolean, returns true if the content of an element is editable, otherwise it returns false
The following code shows how to check if a <p> element is editable or not:
<!DOCTYPE html> <html> <body> <p id="myP" contenteditable="true">Click the button to find out if I am editable.</p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from ww w. ja v a 2 s . com var x = document.getElementById("myP").isContentEditable; document.getElementById("demo").innerHTML = x; } </script> </body> </html>