<!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=utf-8" />
<title>无标题文档</title>
<style type="text/css">
div.center{
float:left;
margin-right:30px;
}
button{}
select {
width:100px;
height:300px;
}
</style>
<script src="../../jquery-1.11.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
//移动到右边
$("#remove1").click(function(){
$("#select1 option:selected").appendTo("#select2");
});
//移动到左边
$("#remove2").click(function(){
$("#select2 option:selected").appendTo("#select1");
});
//全部移动到右边
$("#remove1_all").click(function(){
$("#select1 option").appendTo("#select2");
});
//全部移动到左边
$("#remove2_all").click(function(){
$("#select2 option").appendTo("#select1");
});
//双击选中右边
$("#select1").dblclick(function(){
$("#select1 option:selected").appendTo("#select2");
});
//双击选中左边
$("#select2").dblclick(function(){
$("#select2 option:selected").appendTo("#select1");
});
});
</script>
</head>
<body>
<div>
<div class="center">
<select multiple="multiple" id="select1">
<option>jquery101</option>
<option>jquery201</option>
<option>jquery301</option>
<option>jquery401</option>
<option>jquery501</option>
<option>jquery601</option>
</select>
<div>
<button id="remove1">选中》》</button><br/>
<button id="remove1_all">全部》》</button>
</div>
</div>
<div>
<select multiple="multiple" id="select2">
<option>jquery011</option>
<option>jquery021</option>
<option>jquery031</option>
<option>jquery041</option>
<option>jquery051</option>
<option>jquery061</option>
</select>
</div>
<div>
<button id="remove2">选中《《</button><br/>
<button id="remove2_all">全部《《</button>
</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
div.center{
float:left;
margin-right:30px;
}
button{}
select {
width:100px;
height:300px;
}
</style>
<script src="../../jquery-1.11.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
//移动到右边
$("#remove1").click(function(){
$("#select1 option:selected").appendTo("#select2");
});
//移动到左边
$("#remove2").click(function(){
$("#select2 option:selected").appendTo("#select1");
});
//全部移动到右边
$("#remove1_all").click(function(){
$("#select1 option").appendTo("#select2");
});
//全部移动到左边
$("#remove2_all").click(function(){
$("#select2 option").appendTo("#select1");
});
//双击选中右边
$("#select1").dblclick(function(){
$("#select1 option:selected").appendTo("#select2");
});
//双击选中左边
$("#select2").dblclick(function(){
$("#select2 option:selected").appendTo("#select1");
});
});
</script>
</head>
<body>
<div>
<div class="center">
<select multiple="multiple" id="select1">
<option>jquery101</option>
<option>jquery201</option>
<option>jquery301</option>
<option>jquery401</option>
<option>jquery501</option>
<option>jquery601</option>
</select>
<div>
<button id="remove1">选中》》</button><br/>
<button id="remove1_all">全部》》</button>
</div>
</div>
<div>
<select multiple="multiple" id="select2">
<option>jquery011</option>
<option>jquery021</option>
<option>jquery031</option>
<option>jquery041</option>
<option>jquery051</option>
<option>jquery061</option>
</select>
</div>
<div>
<button id="remove2">选中《《</button><br/>
<button id="remove2_all">全部《《</button>
</div>
</div>
</body>
</html>