是么
<script>
opener.document.all.selectname.options.add("x","xxx"); '不行么
</script>

解决方案 »

  1.   

    运行时间错误,类型不匹配
    mozilla也无效了我原来用的是selectname.options[i].new Option('a','a')
      

  2.   

    刚才试了一下,不能通过opener.document.selectname.options[i].new Option('a','a')
    这种方式添加.不过,其实,你可以这样子添加啊.parent.htm<select name=sel>
    </select>
    <input type=button onclick="window.open('son.htm')" value="Open">
    <script>
    function add2()
    {
        var addoption2 = new Option("Text","Value");
        var sel = document.all.sel;
        sel.options[sel.options.length] = addoption2
    }
    </script>son.htm
    <!--调用父窗口的方法add2()来实现添加.-->
    <input type=button onclick="opener.add2()">
      

  3.   

    main.html
    <html>
    <head>
    </head><body bgcolor="#FFFFFF">
    <select id="select" style="width:200px">
    <option>111</option>
    <option>222</option>
    <option>333</option>
    <option>444</option>
    <option>555</option>
    </select>
    <button onclick="window.open('a.html')">open</button>
    <script language="JavaScript">
    <!--
    function addSel(txt,value)
    {
    var obj = document.all.select;
    obj.options.add(new Option(txt, value));
    }
    //-->
    </script>
    </body>
    </html>
    a.html
    <html>
    <body bgcolor="#FFFFFF">
    <input type="text" name="txt"><input type="text" name="val"><button onclick="kiss()">goooooooo</button>
    <script language="JavaScript">
    function kiss()
    {
        opener.addSel(document.all.txt.value,document.all.val.value);
    window.close();
    }
    </script>
    </body>
    </html>
      

  4.   

    非常好
    ie和mozilla都实现了