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));
}
{alert(Obj);
var b=parent.document.getElementById("select2");
// clear all
b.options.length = 0;
// add
b.options.add(new Option(Obj,Obj));
}
<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