function deleteoption() {
for (i=0;i<document.all.select.options.length;i++) {
if (document.all.select.options[i].selected) {
document.all.select.options.remove(i);
}
}
}PS:你写的deleteoption()中的i--,会造成死循环。

解决方案 »

  1.   

    function deleteoption() {
    document.all.select.options.remove(document.all.select.selectedIndex);
    }
      

  2.   

    是直接贴过来的 所以有点乱!!!   还是不行 和 以前报的错一样 在:
    <body oncontextmenu="//return false;">     
    <formaction="/servlet/com.beltino.oa.parameter.WorkDay"method="post"name="frame">
    请输入列表项
    <input name='txt' type='text'>
    <INPUT TYPE="button" NAME="button" VALUE="确定" ONCLICK="workday();" onmouseover="this.focus();">
    <select name='select' size='8' MULTIPLE style='width: 230px;'>
    </select>
    <INPUT TYPE="button" NAME="deleteoption" VALUE="删除" ONCLICK="deleteoption();" onmouseover="this.focus();">
    </form></body>报的错是  对象不支持属性和方法  就是指上面那代码  我想应该是ONCLICK="deleteoption();" 这个出问题了  但又看不出哪里的问题 晕
      

  3.   

    不要用select这样的关键字做控件的名字
    function deleteoption() {
    for (i=0;i<document.all.myselect.options.length;i++) {
    if (document.all.myselect.options[i].selected) {
    document.all.myselect.options.remove(i);
    }
    }
    }
      

  4.   

    to ttyp
    晕 我也改成你那样的  你试试我这网页  文本框中的值等传到SELECT中去 但我选中SELECT中的值,却还是和以前一样的错误 对象不支持属性或方法!!!!郁闷中!!!!  求救!!1
      

  5.   

    <INPUT TYPE="button" NAME="deleteoption" VALUE="删除" ONCLICK="deleteoption();" onmouseover="this.focus();">
    你的按钮名字和函数名字重复了。