I have some JavaScript code that does some stuff, but at some point I need to do this:
$('#mySpan').text('Hello\nWorld');
Here is my HTML code:
<span id="mySpan"></span>
So I can finally get this:
Hello
World
The problem is that HTML is not detecting the breakline inserted from the JavaScript. I also tried this:
$('#mySpan').text('Hello<BR/>World');
But it doesn't work either.
How should I do it?