Pages

Saturday, June 20, 2015

#deepstutorials: how to get the value of a textarea in jquery?


The following code creates a form with a textarea

<html>
<body>
<form action="demo_form.asp">
<textarea rows="4" cols="50" id= "comment" name="comment">
Enter text here...</textarea>
<input type="submit">
</form>
</body>
</html>
 


To access textarea using jquery ,following is the way
var message = $('comment').val();

No comments:

Post a Comment