javascript: for loop
<p>Why this for loop doesnt work?</p>

<p>javascript:</p>

<pre><code>function create(){
    var newDiv = document.createElement("input");
    var character = "piyush";

    var i =0;

    newDiv.type = "text";
    newDiv.style.background = "red";
    newDiv.style.width ="20px";
    newDiv.style.height ="20px";
    for( i =0; i&lt; character.length ; i++)
    {

    document.getElementById("tryingin").appendChild(newDiv);
    }

 }
</code></pre>

<p>html:</p>

<pre><code>&lt;div id="tryingin" onMouseOut="create()" style="width:200px; height:200px; background-color:black"&gt; &lt;/div&gt;
</code></pre>

<p>now when i alert something in the for loop . i see the alert box 6 times one after the other(as character.length == 6). but why i dont see 6 textboxes appended in the division?
And what should be the correct code to append all 6 textboxes all at once.</p>

<p>Help appreciated.
Regards!</p>
