<form name=f>
<select name=s onchange="alert(this.value)">
<option value="aa">aa</option>
</selct>
<input type=button onclick="a()" value=add>
</form>
<script language=javascript>
var i=0
function a()
{
b=document.f.s
var opt=new Option("text"+ i,"value"+i,true,true)
b.options[b.options.length] = opt
i++
}
</script>

解决方案 »

  1.   

    <select id=sel1></select>
    <input id=str>
    <button onclick="add()">add</button>
    <script language="JavaScript">
    <!--
    function add(){
     var e=document.createElement("OPTION");
     e.value = str.value;
     e.innerText = str.value;
     sel1.appendChild(e);}
    //-->
    </script>
      

  2.   

    <select id="select1"></select>
    <script language="JavaScript">
      var objOption = document.createElement("OPTION")
      select1.options.add(objOption)
      objOption.value = "选项的值"
      objOption.text = "显示的文本"
      
    </script>
      

  3.   

    http://lucky.myrice.com/javascriptexam/add_del_Select.htm
    http://lucky.myrice.com/javascriptexam/radioforselect.html