I've seen a few questions about how to add a new line in JavaScript strings. Most of them are suggesting to use \n
. I tried that but the new line is not inserted on my HTML.
Instead I get the following:
<strong>This is the first line
This is the second line</strong>
This is my string:
var myString = "This is the first line \n This is the second line";
Any idea on how I can get a
inserted on my HTML?
, second by \n – bksi Aug 14 '16 at 11:19