<input type=button onclick="abc.length=0">

解决方案 »

  1.   

    document.getElementById("abc").options.length=0
      

  2.   

    <script type="text/javascript">
    //<![CDATA[
    window.onload=function(){
    document.all.abc.length=0;
    }
    //]]>
    </script>
      

  3.   

    document.getElementById("abc").options.length=0
      

  4.   

    document.getElementById("abc").options.length=0书上说:这样可以
      

  5.   

    首先推荐你用id来标识<select id="abc"> 
    <option value="a">a</option> 
    <option value="b">b</option> 
    </select><script language="javascript">var clearSelectById = function(){
    var obj = document.getElementById('abc');var list =obj.childNodes;
    for( var i in list){
    obj.removeNode(list[i]);}
    }
    </script>
    <a href="javascript:void(0);" onclick="clearSelectById();">删除</a>
      

  6.   

    懒狗的方法好.有dom的概念哦.
      

  7.   

    document.getElementById("abc").options.length=0
    这个是正解
      

  8.   

    方法一:
    //注意:清除下拉列表框中的各项用removeChild(document.form1.abc.options[0])函数,
    //为什么老是只清除document.form1.abc.options[0]第一项呢?因为为我们清除一项时,第二项会自动上移一项,这也就是为什么老是只清除第一项的原因
    for(var j=0;j<document.form1.abc.options.length;j++)//先清除原来的
    {
    document.form1.abc.options.removeChil(document.form1.abc.options[1]);
    }方法二:obj.options.length = 0
      

  9.   

    <script language="Javascript">

    function Remove()

    var objsel = document.getElementById("lbReady"); for(var i = objsel.options.length - 1 ;i >= 0;i--)
    {
        if(objsel.options[i].selected)
    {
    objsel.remove(i)
    }
     }
    return false; 
    }
    </script>
      

  10.   

    对于Array 和 Array-like ,都可以用设置length=n的方法,保留前n个元素,后边的被解释器回收