how to get the value of a textarea in jquery? how to get the value of a textarea in jquery? jquery jquery

how to get the value of a textarea in jquery?


Value of textarea is also taken with val method:

var message = $('textarea#message').val();


You need to use .val() for textarea as it is an element and not a wrapper. Try

$('textarea#message').val()

Updated fiddle


you should use val() instead of html()

var message = $('#message').val();