+ 3
Problem, creating a new line using "\n" is not working in javascript !!
7 Respuestas
+ 4
use <br> instead
document.write("first line <br>this is a new line");
+ 2
Nope be doesn’t work
+ 2
@Tony Isotalo is right, but some browsers do not yet accept the <br> style and will still require the ending slash used in self-closing HTML elements like
<br />
Just tested with your code above and this works fine.
+ 2
@Martin Taylor yeah thank you, it makes sense now, i was just confused because you can't run a code in javascript without using html in sololearn. so it works if it's only javascript, right ?
+ 1
Br
- 1
I'm not sure yet but I should like so /n