title: Generate multiple html inputs with javascript
body: <p>I have a <code>form</code> which the user will write a <code>number (int)</code> he wants, and then there's a <code>button</code> besides this <code>textbox</code> that must read the <code>value</code> written on the <code>input</code> and create the exact numbers of <code>textboxes</code> which the user had written in a <code>modal</code>. </p>
  
  <p>This is what I've been trying so far, but I can't get any kind of result.</p>
  
  <pre><code>&lt;input id="my_input" name="test1"  type="text" value="" &gt;
  
  &lt;button data-toggle="modal" data-target="#myModal" onclick="add_input()" id="add_input1"  name="" type="submit"&gt;GO&lt;/button&gt;
  
   &lt;script&gt;
  function add_inputs()
  {
      n = $('#my_input').val();
      console.log(n);
  
      for (var i = 1; i &lt; n; i++);
          console.log(i);
  
      $("#rolonum_" + i).html('&lt;span&gt;Item 1&lt;/span&gt;&lt;input id="rolo_add' + i + '" name="addposition"  type="text" value="" required/&gt;');
  }
  
  &lt;/script&gt;
  </code></pre>