Dave Partner

Javascript tutorial - 21 - For Loop

  • 0 Replies
  • 166 Views

0 Members and 1 Guest are viewing this topic.

*

Offline Dave Partner

  • Administrator
  • Full Member
  • *****
  • 116
    • View Profile
Javascript tutorial - 21 - For Loop
« on: January 01, 2017, 04:43:59 AM »
&index=20
<html>
   <head>
      <title></title>
   </head>
   <body>
      <script type="text/javascript" >
         /*
         FOR LOOP
         for (initialization; test condition; iteration statement){
               Statement(s) to be executed if test condition is true
            }
         
         
         */
         
         for(var x = 15; x > 0; x--){
           
            document.write(x + ": Hello world again <br/>");
           
            x--;
         }
         
         
         
               
      </script>
   </body>
</html>
« Last Edit: January 03, 2017, 01:50:37 PM by Dave Partner »