function selectfenlei(Obj)
{alert(Obj);
var b=parent.document.getElementById("select2");
// clear all
b.options.length = 0;
// add
b.options.add(new Option(Obj,Obj));
}

解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head><body>
    <form name="form1">
    <select name="n1">
    <option value="xx1">xxx</option>
    <option selected="selected" value="yy1">yyy</option>
    <option value="zz1">zzz</option>
    </select>
    <input type="button" value="add" onclick="add();" />
    </form></body>
    </html><script type="text/javascript">function add()
    {
    document.form1.n1.options.add(new Option("mmm","mm"));}</script>--
    添加option