title: Print a given sentence , given times, using javascript
body: <p>i'm new to programming, wanted to practice.
  I wanted to make an html document with javascript embedded, the document will have two input fields in one field the user will type the sentence and in the second field she will type how many times she wanna print it, than when she click on the button the script will print that text in the "printhere" div.<br>
  i tried but failed, following is my code, can someone please tell me what i am messing ?</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;!-- form started --&gt;
  &lt;form&gt;
  &lt;!-- what sentence to print --&gt;
  What to write?&lt;br&gt;
  &lt;input id="what"&gt;&lt;br&gt;&lt;br&gt;
  
  &lt;!-- how many times to print --&gt;
  How many times ?&lt;br&gt;
  &lt;input id="howmany"&gt;&lt;br&gt;&lt;br&gt;
  
  &lt;!-- the button --&gt;
  &lt;button type="button" onclick="printItNow()"&gt;Print Now&lt;/button&gt;
  &lt;form&gt;
  &lt;!-- form ended --&gt;
  
  &lt;!-- the div where the content will print --&gt;
  &lt;div id="printhere"&gt;
  
  &lt;/div&gt;
  
  
  &lt;script&gt;
  function printItNow() {
      var printhere = document.getElementById('printhere');
      var whatto = document.getElementById('what');
      var howmany = document.getElementById('howmany');
  
  
      for (var i=0; i&lt;howmany; i++) {
          printhere.innerHTML += whatto;
      }
  }
  
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;html&gt;
  </code></pre>
  
  <p>thank you all. :)</p>