In this code I want to insert some HTML and normal text in JavaScript and don't want it to always enter document.write(" in starting of each line like:
document.write("some text
some text
some text");
Instead of this:
document.write("Hello World!");
document.write("Have a nice day!");
document.write("<br>");
document.write("<p>some random paragraph");
document.write("Hello World!");
document.write("Have a nice day!");
document.write("<br>");
document.write("<p>some random paragraph");
⚠ Warning: Use of the document.write() method is strongly discouraged.
innerHTML of the document body (or whatever element you want).document.body.innerHTML = `
Hello World!<br />
Have a nice day!<br />
<p>some random paragraph</p>
`;
document.body.innerHTML = `
your text
<br>
your text
`;