Introduction To Programming document.write(); function
Eric123 Some St.1012.99
document.write(); does not make its output go on the next line. You have to do that yourself. Here's how to do it:
document.write("<br />"); (add a line break tag to the output)document.write("\n"); (add a line break escape character to the output)document.writeln("..."); (use writeln to add a carriage return)
Eric
123 Some St.
10
12.99
That's better!
You practiced creating some JavaScript variables and then displaying their values on the lab page. You learned that we need to add a line break in our output to have new lines of text.