+ 2
JavaScript line break
document.write(" I am \n learning js"); I wrote this code but line is not breaking why.
2 Answers
+ 8
Try the <br> tag instead of '\n'.
+ 3
Adnan Ur Rehman
document.write(someContent) writes someContent to the document as html markup. That means someContent is treated as html code. So, to put a line break in a html document we need <br/> element.