0
How can i separate two variables when show on screen?
I did the code var x = 100; document.write(x); var d = 50; document.write(d); And it shows 10050 but i would like for it to show like this. 100 50 How can i do this?
3 ответов
+ 5
You can add the following line to break the text using HTML tag:
document.write("<br/>");
So the result will be this:
var x = 100;
document.write(x);
document.write("<br/>");
var d = 50;
document.write(d);
And it shows:
100
50
You also can do something like this:
var x = 100;
var d = 50;
document.write(x + "<br/>" + d);
0
I usually do document.write(x+", "+d)
- 1
document.write(x + "<br/>" +d);