Get value from textarea - Javascript jQuery

Javascript examples for jQuery:Form Textarea

Description

Get value from textarea

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> 
   </head> 
   <body> 
      <textarea>Test Content</textarea> 
      <script type="text/javascript">
$(document).ready(function () {
    var val = $.trim($("textarea").val());
    if (val != "") {
        console.log(val);
    }/*from   w  w  w .j  a v a 2 s  .  com*/
});

      </script>  
   </body>
</html>

Related Tutorials