Javascript examples for DOM:Element contentEditable
Set element contentEditable property to true
<html> <head></head> <body> <div id="myP"> This is a paragraph. Click the button to make me editable. </div> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() {/* ww w. j a v a2s .c om*/ document.getElementById("myP").contentEditable = true; document.getElementById("demo").innerHTML = "The p element above is now editable. Try to change its text."; } </script> </body> </html>