I cant do new line from javascript, I tried to do that with \n, but nothing.
document.getElementById("text").textContent = "hhh" + '\n' + "df";
<h1 id="text">
abc
</h1>
Changing textContent to innerText will do it.
document.getElementById("text").innerText = "hhh" + '\n' + "df";
<h1 id="text">
abc
</h1>
The line break behavior is standardized.
textContent.Apparently you are pretty new in javascript. You should use <br> instead. \n new line for console outputs. Also you should use innerHTML instead of textContent.
document.getElementById("text").innerHTML = "hhh" + '<br>' + "df";
<h1 id="text">
abc
</h1>
With textContent
document.getElementById("text").textContent = "hhh" + '<br>' + "df";
<h1 id="text">
abc
</h1>
Console example:
console.log("abc\ndef");