I know how to fill a text field, but how to fill it so that it supports line breaks?
eg
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 blah just swing in the text box on the same line. Any ideas?
edit: I'm trying to use html () instead of text, but it gives the same result. I would suggest that using html () I would get a text box with "
"but that's not the case ... its just all on one line.
Even with this code:
$('#previous_purchases').click(function(){ var what = $(this).html(); $('#purchased').html(what); });
jquery
willdanceforfun
source share