I have a piece of JavaScript that is supposed to update a in my HTML:
var StringContent = ({
"a": 'Some String a',
"b": 'Some string b',
"c": 'Some string c',
});
Then I want each string a, b, c displayed on a new line via:
document.getElementById("overlaycontent").innerHTML = (
StringContent.a + '\n' +
StringContent.b + '\n' +
StringContent.c,
)
All I get at the moment is everything in a single line. How do I create a new line in my text without adding more divs? I also tried \r, but that also does not help. I looked at the docs, but it keeps saying to use \n.
<br>instead of\n.classor block element and let CSS do the work.<br>. You could also generate conteint within<pre>tags which do respect the white space.