New course! Every coder should learn Generative AI!
Try a free lesson+ 4
document.write(); indent problem
This code is printed right night to each other: document.write("Hello"); document.write("World"); How do I get them to indent so they're each on separate lines?
4 Answers
+ 4
I've already tried combining them into one document.write and using \n, but it didn't work.
+ 4
Thanks so much guys! Check out Interest Calculator 2.1 in my codes.
+ 3
document.write("Hello");
document.write("<br/>");
document.write("World");
<br/> is used to break line in html. You are using document.write means it will write your data in html webpage, thatswhy \n is not working. \n work on console in browser.
+ 1
:) Try to add document.write("<br/>"); between the lines.