Javascript examples for DOM HTML Element:Textarea
Get textarea value and use button for accepting input
<html> <head> <script> function getText() {//from w w w.j a v a 2 s . c om var str=document.getElementById("txtArea").value; document.getElementById('output').innerHTML +=str + " i did it"; } </script> </head> <body> <textarea rows="5" cols="30" id="txtArea"> </textarea> <input type="button" value="click here" onclick="getText();"> <div id="output"></div> </body> </html>