title: generate textboxes based on number enter by user
body: <p>I want when a user enter number in the textbox and click set, textboxes appear based on the number he entered and this what I come up with but it is not working please help </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function generate(){
  var a=parseInt(document.getElementById("nochapter").value);
  for (i=0;i&lt;=a,i++){
  document.getElementById("ch").innerHTML="&lt;input type='text' &gt;"}}
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt; Prepare new assessment&lt;/h1&gt;
  &lt;form&gt;
  No. of Chapter included &lt;input type="text" id="nochapter" &gt; 
  &lt;input type ="button" value="set" onclick="generate()"&gt;
  
  &lt;div id="ch"&gt;&lt;/div&gt;    
  </code></pre>