1. 清空 <div class="wp_syntax">
    selectEle.options.length = ;
    </div>
    
  2. 添加 <div class="wp_syntax">
    var option = new Option("text1","value1");
     
    try{
        selectEle.add(option,null); // for firefox
    }catch(e){
        selectEle.add(option,-1); // for IE
    }
    </div>
    
也可以直接操作selectEle.options , 不过注意options 是一个伪数组(更arguments 一样), 不是一个数组.

<div class="wp_syntax">
  <div class="code">
    <pre class="javascript" style="font-family:monospace;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>selectEle.<span style="color: #660066;">options</span> <span style="color: #000066; font-weight: bold;">instanceof</span> Array <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span></pre>
  </div>
</div>
  1. 获得选择的选项. (可以是 multiple 的) <div class="wp_syntax">
    var selected = [];
    for(var i =  ; i &lt; selectEle.options.length; i ++)
    {
        if(selectEle.options[i].selected)
       selected.push(selectEle.options[i]);
    }
    </div>