Skip to content
Related Articles

Related Articles

HTML | DOM isContentEditable Property

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 25 Jul, 2019

The DOM isContentEditable property is used to return a boolean where true means the content of an element is editable and false represents content is not editable. This property is read-only.



Return Value: This property returns a boolean value.

  • true means that the content of an element is editable.
  • false means that the content of an element is not editable.


<!DOCTYPE html>
      DOM iscontentEditable Property
<body style="text-align: center">
    <h1 style="color:green">
            DOM iscontentEditable Property
    <span id="P" contenteditable="true">
      Span 1 is editable.
    <span id="P1">
      Span 2 is non editable.
    <button onclick="myFunction()">
      Click me!
    <p id="d"></p>
    <p id="d1"></p>
        function myFunction() {
            var x =
            var y =
            document.getElementById("d").innerHTML =
                "Span 1 is editable: " + x;
            document.getElementById("d1").innerHTML =
                "Span 2 is editable: " + y;

Before clicking the button:
After clicking the button:

Supported Browsers: The browser supported by isContentEditable property are listed below:

  • Google Chrome 11.0
  • Internet Explorer 5.5
  • Firefox 3.0
  • Opera 10.6
  • Safari 3.2

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!