title: For loop and getElementById
body: <p>Hopefully an easy one, but I am having trouble printing out a number series from a for loop, back to the HTML. See below for my code, when I hit the button, it only returns 10, but not the rest of the numbers - where am I going wrong?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;body&gt;
      &lt;button onclick="myFunction()"&gt;Try It&lt;/button&gt;
      &lt;p id="number"&gt;&lt;/p&gt;
      &lt;script&gt;
      function myFunction() {
          for (i=0; i&lt;11; i++) {
              document.getElementById("number").innerHTML=i+"&lt;/br&gt;";
          } 
      }
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>