Computer >> Computer tutorials >  >> Programming >> Javascript

How to create a line break with JavaScript?


To create a line break in JavaScript, use “<br>”. With this, we can add more than one line break also.

Example

Let’s see it in the below example:

<html>
   <body>
      <script>
         <!--
            document.write("Hello World!");
            document.write("<br>");
            document.write("Demo<br><br>Text!");
          //-->
      </script>
   </body>
</html>