matt2099
10/5/2018 - 1:42 PM

ForLoop

Create a for loop in HTML

<DOCTYPE html>
<html>
  <head>
      <title> While and Do While Loops</title>
    </head>
<body>
  <script>
    function count()
    {
      for(var i = 0; i < 101; i++)
      {
        document.getElementById("output").innerHTML += i + ""<br/>"; 
      }
    }



  </script>
  <p id= "output"></p>
  <button onclick="count()">Count</button>
</body>
</html>