dropdown menu using javascript
<p><em>i want to create a form in which firstly the computer will ask the no of options and then 
he would ask for the option values. i want to code this using javascript. how can i code it. please help me guys</em></p>

<pre><code>i have a javascript code like this:

   function add1(type) {
     var element = document.createElement("input");
     var label=prompt("Enter the name for lable","");
     labels.push(label);

     document.getElementById('raj').innerHTML=document.getElementById('raj').innerHTML+label+": : ";
     element.setAttribute("type", type);
     element.setAttribute("name",label);

     var no=prompt("Total no of fields in radio button ");

     for(var i=1;i&lt;=no;i++)
     {
        var val=prompt('Enter value');     

     document.getElementById('raj').innerHTML=document.getElementById('raj').innerHTML+val+" ";
     element.setAttribute("value",val);
     var rohit = document.getElementById("raj");
    rohit.appendChild(element);

     }
     document.getElementById("sels").innerHTML=document.getElementById("sels").innerHTML+"&lt;input type='radio' name='label' value='"+label+"'&gt;"+label;
     var con=confirm("Is this field required");
     if(con==true)
     {

    element.setAttribute("required","required");}
     document.getElementById('raj').innerHTML=document.getElementById('raj').innerHTML+"&lt;br/&gt;";


}
</code></pre>
