Exercise:
In the for loop, change
num1
to
0
and
num2
to
10
and run the code.
Edit This Code:
See Result »
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var i; for (i = num1; i < num2; i++) { document.getElementById("demo").innerHTML += i + "<br>"; } </script> </body> </html>
Result:
Show Answer
Correct Code:
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var i; for (i = 0; i < 10; i++) { document.getElementById("demo").innerHTML += i + "<br>"; } </script> </body> </html>
Correct Result:
Hide Answer
Privacy Policy