Javascript examples for Statement:Quiz
Create a for loop that output the numbers 1 3 5 7 9 with line breaks between each number.
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var text = ""; var i;// ww w.ja va2s .c o m for (i = 1; i < 10; i = i + 2) { text += i + "<br>"; } document.getElementById("demo").innerHTML = text; </script> </body> </html>