Polly Polly - 2 months ago 5
Javascript Question

Put a new line in <p> tag

I try to put a new line in a

<p>
(html code):

<p id="text_folder"><p>


This is my jquery code:

$('#text_folder').text("first"+"\n"+"second");


But in my
<p>
tag the result is

first
second

and not:

first

second

Anyone can help me?

Answer
('#text_folder').html("first"+"<br />"+"second")

try this