I'm building a string in JavaScript FE like you can see below, my attempt is to print some data in different rows.
In my JavaScript I build the string the use getElement()
and textContent
to attach the string at the paragraph.
I've tried <br>
<br/>
\n
<\r
, all with no results.
var str;
str+="text" + data[0];
str+= //Here need new line
str+="text" + data[1];
var p=document.getElementById("paragraph");
p.textContent = str;
` tag for a visual new line. For a file on filesystem "\n" works generally. – Silvan Bregy May 09 '22 at 14:05