var X = 1; document.write(X); X = 2; document.write(X); document.write("<br />"); X = 3; document.write(X); document.write("<br />"); document.write("<br />"); X = "drugs"; document.write("Just say \"no\" to " + X + "<br />"); X = "alcohol"; document.write("Just say \"no\" to " + X + "<br />");
In the next line, we change the variable's value to 2 and then print it in the line after that. Then we print a line break or a endline character, which drops the printing position to the beginning of the next line. This is accomplished via the HTML tag <br />. Then the variable is set to 3 and printed, followed by two line breaks.