How to show html elements
<p>I'm trying to create drop down lists when the submit button is pressed. This will go through a while loop to make diffrent number of lists. I currently have the following code but it dosen't work as intended.    </p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;script type="text/javascript"&gt;
            function getvalue() {
                number = document.getnumber.input.value;
                document.getElementById("result").value = number;
            }
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;script&gt;
            function generatedropdown() {
                while (i &lt; number) {
                    html = '&lt;select name="select" id="i"&gt;';
                    html += '&lt;option&gt;Test 1&lt;/option&gt;';
                    html += '&lt;option&gt;Test 2&lt;/option&gt;';
                    html += '&lt;option&gt;Test 3&lt;/option&gt;';
                    html += '&lt;option&gt;Test 4&lt;/option&gt;';
                    html += '&lt;option&gt;Test 5&lt;/option&gt;';
                    html += '&lt;/select&gt;';

                    innerHTML = html;
                    i++;
                }
            }
        &lt;/script&gt;
        &lt;form name="getnumber"&gt;Input number:
            &lt;input type="text" name="input"&gt;
            &lt;input type="button" value="Next" onClick="getvalue()"&gt;
        &lt;/form&gt;
        &lt;form id="showlists"&gt;Number entered:
            &lt;input type="text" id="result" readonly="readonly"&gt;
            &lt;input type="button" value="Show lists" onClick="generatedropdown()"&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>EDIT:
I've changed the code to this but still no luck.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;

function getvalue() {
 number = document.getnumber.input.value;
 document.getElementById("result").value = number; 
} 
&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;script&gt;
function generatedropdown() {
html = '&lt;select name="select" id="i"&gt;';
while (i &lt; number)  {            
html+='&lt;option&gt;Test 1&lt;/option&gt;';
html+='&lt;option&gt;Test 2&lt;/option&gt;';
html+='&lt;option&gt;Test 3&lt;/option&gt;';
html+='&lt;option&gt;Test 4&lt;/option&gt;';
html+='&lt;option&gt;Test 5&lt;/option&gt;';        
i++;
}
html+='&lt;/select&gt;';
document.getElementById("my-output").innerHTML = html;
}
&lt;/script&gt;


&lt;form name="getnumber"&gt;
Input number: &lt;input type="text" name="input"&gt;
&lt;input type="button" value="Next" onClick="getvalue()"&gt;
&lt;/form&gt;


&lt;form id="showlists"&gt;
Number entered: &lt;input type="text" id="result" readonly="readonly"&gt;     
&lt;input type="button" value="Show lists" onClick="generatedropdown()"&gt;
&lt;div id="my-output"&gt;Generated List:&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
