Reputation: 338
I have a drop-down list which causes a text-area to populate with different text depending on what's selected. I have this part working fine, but I'm not able to format the text to show paragraphs. using regular html, just causes it to be printed out.
Does any one know can I create paragraphs, etc?
Thanks Guys!!
Upvotes: 2
Views: 1903
Reputation: 11552
<p>
is an HTML tag. <textarea>
doesn't recognize HTML tags, unless you're using some kind of rich-text editor.
That said, you can create line breaks in your <textarea>
using \n
like this:
$('#my-text-area').text('foo\nbar');
Upvotes: 0