Javascript examples for DOM HTML Element:Textarea
make a div element editable like a textarea when clicking it
<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 av a 2s . c o m*/ document.getElementById("myP").contentEditable = true; document.getElementById("demo").innerHTML = "The p element above is now editable. Try to change its text."; } </script> </body> </html>