title: How to create text box dynamically from javascript
body: <p>I am trying to create textboxes inside <code>&lt;div id="screens"&gt; &lt;/div&gt;</code>. I have a drop down menu for which I select the number of textboxes to be created.</p>
  
  <p>The JavaScript code I've written here is not working:</p>
  
  <p>code:</p>
  
  <pre><code>function create(param) {
      document.getElementById("screens").innerHTML="";          
      for(var i = 0; i &lt; param; i++) {
          alert(i);
          document.write('&lt;input type="text" name="Fname"&gt;');
      }
  }
  </code></pre>
  
  <p>This is adding textboxes by clearing all contents of the current page, but I want the textboxes to be added to  <code>&lt;div id="screen"&gt; &lt;/div&gt;</code>. How can I do this?</p>