<div class="codetitle"> <span><a style="CURSOR: pointer" data="49537" class="copybut" id="copybut49537" onclick="doCopy('code49537')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code49537"> <br><br> <title>無標題頁</title> <br> <script type="text/javascript" src="java/jquery-1.4.2.%20min.js"></script><br> <script type="text/javascript"><BR> $(document).ready(function(){<BR> $('#add').click(function(){<BR> var options=$('#select1 option:selected');<> remove.appendTo( "#select2");<BR> });<BR> 🎜> var options=$('# select1 option');<BR> var remove=options.remove();<BR> });<BR> // 將選擇物退回給對方<BR> $('#remove').click(function(){<BR> var options=$('#select2 option:selected');< remove.appendTo( "#select1");<BR> });<BR> // 🎜> var options=$('# select2 option');<BR> var remove=options.remove();<BR> });<BR> });<BR> </script><br><br><br> <form id="form1" runat="server"> <br> <div id="left"> <br> <div id="left"> <br> ="select1" style="width:100px;height:160px"><br> <option>選項1</option> <br> option><br> <option>選項4</option> <br> <option>選項5</option> <br> 🎜> 選取項目新增至右邊>><br><br> <span id="addAll">全部加到右邊>></span><br> </div> <br> <div id="right"> <br> <select multiple id="select2" style="width:100px;height:160px">" style="width:100px;height:160px"></select> <div> <br> <span id="remove"><br><br> span><br> </span> </div> <br> <br><br><br> </div> </div> </form> </div>