Javascript examples for DOM HTML Element:Textarea
The Textarea object represents an HTML <textarea> element.
You can access a <textarea> element by using getElementById():
<!DOCTYPE html> <html> <body> <textarea id="myTextarea"> text text text//from w ww.ja v a 2 s . c om </textarea> <button type="button" onclick="myFunction()">get the content of the text area</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myTextarea").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>