SOURCE

console 命令行工具 X clear

                    
>
console
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        select {
            width: 170px;
            height: 240px;
            font-size: 18px;
            background-color: #a4ff34;
        }
    </style>
    <script>
        $(function () {
        $("button").eq(0).click(function(){
            $("#sel2").append($("#sel1 option"));
        });
        $("button").eq(1).click(function(){
            $("#sel1").append($("#sel2 option"));
        });
         $("button").eq(2).click(function(){
              $("#sel2").append($("#sel1 option:selected"));
        });
        $("button").eq(3).click(function(){
              $("#sel1").append($("#sel2 option:selected"));
        });
        })
    </script>
</head>
<body>
<select id="sel1" size="10" multiple>
    <option value="0">香蕉</option>
    <option value="1">苹果</option>
    <option value="2">鸭梨</option>
    <option value="3">葡萄</option>
    <option value="4">葡萄1</option>
    <option value="5">葡萄2</option>
    <option value="6">葡萄3</option>
    <option value="7">葡萄4</option>
</select>
<button>>>></button>
<button><<<</button>
<button>></button>
<button><</button>
<select id="sel2" size="10" multiple>

</select>
</body>
</html>

本项目引用的自定义外部资源