[QUOTE]<html >
<head>
<script language="JavaScript">
function addnew(){
if(checked_check("s1") != true){
alert("Please s1 a option!");
return false;
}
var t=document.all.s1;
var tt=document.all.s2;
var text=t.options[t.selectedIndex].innerText;
var value=t.options[t.selectedIndex].value;
tt.options.add(new Option(text,value));
t.options.remove(t.selectedIndex);
t.selectedIndex = 0;
tt.selectedIndex = 0;
}
function remove(){
if(checked_check("s2") != true){
alert("Please s2 a option!");
return false;
}
var t1=document.all.s1;
var t2=document.all.s2;
var text=t2.options[t2.selectedIndex].innerText;
var value=t2.options[t2.selectedIndex].value;
t1.options.add(new Option(text,value));
t2.options.remove(t2.selectedIndex);
t1.selectedIndex = 0;
t2.selectedIndex = 0;
}
function checked_check(idname){
var checkobject = document.getElementById(idname);
var coun = checkobject.length;
for(i=0;i<coun;i++) {
if(checkobject.options[i].selected == true)
return true;
}
return false;
}
function ShowSelect(){
var SelectObj = document.getElementById("s2");
var SelectStr = "";
for(i=0;i<SelectObj.options.length;i++){
SelectStr += "选项["+ SelectObj.options[i].text +"]的值是 "+ SelectObj.options[i].value +"<BR>";
}
document.getElementById("div1").innerHTML = SelectStr;
}
</script>
</head>
<body>
<div id="div1"></div><form id="form1" name="form1" method="post" action="">
<table width="300" border="0" align="center">
<tr>
<td colspan="3"><div align="center">请选择本次会考的考试课目</div></td>
</tr>
<tr>
<td><div align="center">
<select name="select3" size="3" id="s1">
<option value="yw">语文</option>
<option value="sx">数学</option>
<option value="yy">英语</option>
<option value="wl">物理</option>
<option value="hx">化学</option>
<option value="sw">生物</option>
<option value="zz">政治</option>
<option value="ls">历史</option>
<option value="dl">地理</option>
</select>
</div></td>
<td><div align="center">
<p>
<input type="button" name="Submit" onClick=addnew() value="add" />
</p>
<p>
<input type="button" name="Submit2" onClick=remove() value="delete" />
</p>
</div></td>
<td><div align="center">
<select name="select4" size="3" id="s2">
</select>
</div></td>
</tr>
<tr>
<td colspan="3"><div align="center">
<label>
<input type="
button" name="Submit3" onClick=ShowSelect() value="确定" />
</label>
<label>
<input type="reset" name="Submit4" value="重置">
</label>
</div></td>
</tr></table>
</form>
</body></html>[/QUOTE]