Open In App
Related Articles

HTML DOM isContentEditable Property

Improve Article
Save Article
Like Article

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.

Example: In this example, we will use the isContentEditable property


<!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() {
            let x =
            let y =
            document.getElementById("d").innerHTML =
                "Span 1 is editable: " + x;
            document.getElementById("d1").innerHTML =
                "Span 2 is editable: " + y;



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

  • Google Chrome 1.0 and above
  • Edge 12.0 and above
  • Internet Explorer 5.5 and above
  • Firefox 4.0 and above
  • Opera 12.1 and above
  • Safari 3.0 and above

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 15 Jun, 2023
Like Article
Save Article
Similar Reads
Complete Tutorials