Page 1 of 1

How to get the content of textarea using jquery?

Posted: Tue Dec 09, 2014 2:31 pm
by Darrel
I wrote the code below in a click event but it doesn't display the text I typed in the textarea element.

Code: Select all

var message = $("#Message").html();
alert(message);

Code: Select all

<textarea cols="40" rows="10" id="Message" name="Message"></textarea>

Re: How to get the content of textarea using jquery?

Posted: Tue Dec 09, 2014 3:05 pm
by Celauran

Re: How to get the content of textarea using jquery?

Posted: Wed Dec 10, 2014 3:10 pm
by Darrel
Celauran wrote:$('#Message').val()
Thanks for help.