jQuery .append() and linebreaks
<p>I'm using jQuery <code>.append()</code> to build part of a website with data I get from a JSON string. I'm trying to get some content on 2 separate lines, but I can't seem to get it to work.</p>

<p>This is what I've tried:</p>

<pre><code>$('&lt;p/&gt;', { text: 'text before break &lt;br /&gt; text after break' }).appendTo(target);
//output: text before break &lt;br /&gt; text after break

$('&lt;p/&gt;', { text: 'text before break \n text after break' }).appendTo(target);
//output: text before break  text after break
</code></pre>

<p>Is there any way to get the <code>br</code> tag to work within <code>.append()</code>? Or should I scan the string first and slice it at the <code>br</code> tag, so that I can append it piece by piece?</p>
