0

How to get textarea text using jQuery?

$('#mytextarea').val();

$('button').click(function() {
    var text = $('#mytextarea').val();
	console.log(text);
});
<textarea id="mytextarea">this is sample text</textarea>
<br/>

<button>
  Get Textarea Value
</button>
textarea {
  border: 4px solid #dddddd;
  padding: 30px;
}

button {
  border: 2px solid #451244;
  padding: 20px;
}
RUN
add comment
Suggest a different solution or add another example