<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<title>My JSP 'select.jsp' starting page</title>
<script type="text/javascript" src="js/jquery-1[1].3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var num="";
var bac="";
$("#a").change(function(){
num=$("#a").val();
});
$("#b").change(function(){
bac=$("#b").val();
});
$("#ok").click(function(){
if(num==""){
alert("请选择!");
}else{
$("option").remove("."+num);
$("<option value="+num+" class="+num+">"+num+"</option>").appendTo("#b");
}
});
$("#back").click(function(){
if(bac==""){
alert("请选择!");
}else{
$("option").remove("."+bac);
$("<option calss="+bac+">"+bac+"</option>").appendTo("#a");
}
});
});
</script>
</head>
<body>
<select multiple="multiple" id="a">
<option value="a" class="a">a</option>
<option value="b" class="b">b</option>
<option value="c" class="c">n</option>
<option value="ms" class="ms">ms</option>
<option value="dasdasd" class="dasdasd">dasdasd</option>
<option value="sdasda" class="sdasda">sdasda</option>
<option value="daffesdasd" class="daffesdasd">daffesdasd</option>
<option value="bdg" class="bdg">bdg</option>
</select>
<input type="button" id="ok" value=">>" >
<input type="button" id="back" value="back" >
<select multiple="multiple" size="9" id="b"></select>
</body>
</html>