模拟两个选项框中的选项可以互相移动
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="../../js/jquery-3.3.1.min.js"></script>
<style>
#leftName , #btn,#rightName{
float: left;
width: 100px;
height: 300px;
}
#toRight,#toLeft{
margin-top:100px ;
margin-left:30px;
width: 50px;
}
.border{
height: 500px;
padding: 100px;
}
</style>
<script>
//需求:实现下拉列表选中条目左右选择功能
$(function () {
$("#toLeft").click(function () {
$("#leftName").append($("#rightName > option:selected"))
});
$("#toRight").click(function () {
$("#rightName").append($("#leftName > option:selected"))
});
});
// $(function () {
// //toRight
// $("#toRight").click(f