是不是要这种效果?
[CODE]<html>
<head>
<title></title>
</head>
<script language="JavaScript">
function addnew(){
var t=document.all.s1;
var text=document.all.txt1.value;
var value=document.all.txt2.value;
document.all.s1.options.add(new Option(text,value));
}
</script>
<body>
Text:
<input id=txt1 value=ddd><br>
Value:
<input id=txt2 value=ddd><br>
<input type=button onclick=addnew() value=add>
<br>
<select id=s1>
<option value=one selected>one</option>
<option value=two>two</option>
</select>
</body>
</html>[/CODE]
[此贴子已经被作者于2007-2-9 14:11:37编辑过]