Add <br> in a JavaScript string
HTML
<div id="newline"></div>
JavaScript
var myString = "This is the first line \n This is the second line";
var newLine = document.getElementById('newline');
newline.innerHTML = myString;
<div id="newline"></div>
var myString = "This is the first line \n This is the second line";
var newLine = document.getElementById('newline');
newline.innerHTML = myString;