1<!DOCTYPE html>
2<html>
3 <body>
4 <h2>Adding line break</h2>
5 <script>
6 var myArray = 'This is demo text 1!~This is demo text 2!~~This is demo text 3!~This is demo text 4!~~This is demo text 5!';
7 document.write("Original Array: "+myArray);
8 var brk = myArray.split('~');
9 var res = brk.join(" <br> ");
10 document.write("<br><br>"+res);
11 </script>
12 <p>Each occurence of ~ adds a line break above.</p>
13 </body>
14</html>