title: for loop and innerHTML
body: <p>How do I populate some text with a paragraph using innerHTML? I need to enter a number into the textbox and then repeat some text as many times as the number entered into the textbox.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;ex10.js&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input type="text" id="input-type" onKeyUp="myFunction()"&gt;
      &lt;p id="sample-text"&gt;Here is some text&lt;/p&gt;
      &lt;script&gt;
          function myFunction() {
              let count = document.getElementById("input-type").value;
              document.getElementById("sample-text").innerHTML = count;
  
              if (isNaN(count)) {
                  document.getElementById("sample-text").innerHTML = "Error. Not a number";
              }
              else {
                  for(int i = 0; i &lt; count; i++) {
                      document.getElementById("sample-text").innerHTML = "This is some text";
                  }
  
              }
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>