上午的<select id=a1 onchange=del(this)>
</select>
<script>
var newArr=new Array('theFirst','theSecond');
var newOption1 = new Option(newArr[0],newArr[0]);
var newOption2 = new Option(newArr[1],newArr[1]);
document.all.a1.add(newOption1,0);
document.all.a1.add(newOption2,1);function del(e){
e.remove(e.selectedIndex) ;
}
</script>

解决方案 »

  1.   

    function addNewOpt(fld,text,value){
    //这是添加一个Option的函数
    var el;
    el = document.createElement("OPTION");
    el.text = text;
    el.value = value;
    fld.options.add(el);
    }
    function clearOptions(sel){
    //清除某个Select的全部Option
    var selLen=sel.length;
    for (i=0;i<selLen;i++){
    sel.remove(0);      
    }
    }
      

  2.   

    use (assume nIndex is the index for the option you want to delete, it is 0 based):1. document.all.a1.remove(nIndex);
    2. document.all.a1.options[nIndex] = null;