Access the value of a textarea with javascript - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

Access the value of a textarea with javascript

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from  ww  w . j  a  v a2 s.c o m
console.log(document.getElementById("test").value);
    }

      </script> 
   </head> 
   <body> 
      <center> 
         <div id="response-text"> 
            <textarea id="test" name="test" rows="10" cols="80">Answer here</textarea> 
         </div> 
      </center>  
   </body>
</html>

Related Tutorials