我有這種形式,並試圖從文本區域獲取價值。由於某種原因,它不想。如何獲得jquery中textarea的值?
<form action="/profile/index/sendmessage" method="post" enctype="application/x-www-form-urlencoded">
<div class="upload_form">
<dt id="message-label"><label class="optional" for="message">Enter Message</label></dt>
<dd id="message-element">
<textarea cols="60" rows="5" id="message" name="message"></textarea></dd>
<dt id="id-label"> </dt>
<dd id="id-element">
<input type="hidden" id="id" value="145198" name="id"></dd>
<dt id="send_message-label"> </dt>
<dd id="send_message-element">
<input type="submit" class="sendamessage" value="Send" id="send_message" name="send_message"></dd>
</div>
</form>
$("input.sendamessage").click(function(event) {
event.preventDefault();
var message = $('textarea#message').html();
var id = $('input#id').val();
console.log(message + '-' + id);
});
什麼想法?文字區域