Edit This Code:
See Result »
<
!DOCTYPE
html
>
<
html
>
<
body
>
<
p
id
="demo"
>
<
/p
>
<
script
>
var
cars = [
"BMW"
,
"Volvo"
,
"Saab"
,
"Ford"
];
var
i =
0
;
var
text =
""
;
while
(cars[i]) {
text += cars[i] +
"<br>"
;
i++;
}
document.getElementById(
"demo"
).innerHTML = text;
<
/script
>
<
/body
>
<
/html
>
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var cars = ["BMW", "Volvo", "Saab", "Ford"]; var i = 0; var text = ""; while (cars[i]) { text += cars[i] + "<br>"; i++; } document.getElementById("demo").innerHTML = text; </script> </body> </html>
Result:
Privacy Policy