对了,页面载入时是空的select,即
<select id="lbxAccepter"></select>
点击“增加选项”时再加入option的
然后再点击增加的option,会出现上述问题

解决方案 »

  1.   

    在IE下测试,没有出现lz所说的情况,lz用的是什么浏览器?<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>new page</title>
    <script>
    function getSelectedOption(obj){
       //obj.selectedIndex = obj.selectedIndex;
        alert(obj.selectedIndex);
    }
    function add(){
    var s=document.getElementById("lbxAccepter");
    var n=hid.value;
    hid.value=parseInt(n)+1;
    var op=new Option(n,n);
    s.add(op);
    }
    </script>
    </head>
    <body>
    <select id="lbxAccepter" onchange=getSelectedOption(this)>
    </select>
    <input type=button onclick=add()>
    <input type=hidden id=hid value=0>
    </body>
    </html>
      

  2.   

    我知道啦,用了onclick事件,应该用onchange~
    结贴