How do I write a <br/>
tag in JavaScript?
To create a line break in JavaScript, use “<br>”.
There are multiple correct ways to use a br tag in the web documents. In HTML, a line break is made with the <br> tag. We don't need to close <br> because it's an empty tag. To break a line, either <br/> or <br></br> are acceptable.
To add a line break in array values for every occurrence of ~, first split the array. After splitting, add a line break i.e. <br> for each occurrence of ~. For example, This is demo text 1!~This is demo text 2!~~This is demo text 3!
document.write('<br/>');
this should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With