Hi there, I know how to populate a textarea, but how to populate it so that it maintains the line breaks?
e.g
html
<div id="previous_purchases">blah blah blah<br />blah blah</div>
jquery
$('#previous_purchases').click(function(){
var what = $(this).text();
$('#purchased').text(what);
});
All the blah's just rock up in the textarea on one line. Any ideas?
edit: I have been trying with html() instead of text but it produces the same result. I would imagine by using the html() I would end up with a textarea that had '
' but that is not the case... its just all on one line.
Even with this code:
$('#previous_purchases').click(function(){
var what = $(this).html();
$('#purchased').html(what);
});