Categories
JavaScript Answers

How to create a new line in JavaScript?

Spread the love

To create a new line in JavaScript, we call document.write.

For instance, we write

document.write("<br>");

to add a br line break element.

Or we write

document.write("\n");

to add a new line

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *