Skip to content
Related Articles

Related Articles

HTML | DOM contentEditable Property

Improve Article
Save Article
  • Last Updated : 30 Nov, 2019
Improve Article
Save Article

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


  • Returns the contentEditable property:
  • Set the contentEditable property:
    HTMLElementObject.contentEditable = true | false

Return Value: This property returns a Boolean value:

  • True – It means the content of an element is editable.
  • False – It 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 contentEditable Property 
    <span id="P" contenteditable="true"
        Span 1 is editable.
    <button onclick="GFGFun()"
    <p id="pid"></p
    <p id="pid1"></p
        function GFGFun() { 
            var gfgvar = 
            document.getElementById("pid").innerHTML = 
                "Span 1 is editable: " + gfgvar; 


  • Before Click on Button:
  • After Click on Button:

Supported Browsers: The browser supported by contentEditable attribute are listed below:

  • Chrome
  • Firefox
  • Internet Explorer
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!