想做个 http://www.helloweba.com/view-blog-62.html 的例子  可是这里是用PHP搞的 而且我在我这里用asp.net 搞了好久 都不尽人意 不知道哪位大虾高过这个 最好可以搞个列子 然后把源码贴出来吧 

解决方案 »

  1.   

    <!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" />
    <script src="http://www.xsborts.com/hbcms/script/jquery/jquery_1.3.1.js" type="text/javascript"></script>
    <title>鏃犳爣棰樻枃妗?/title>
    </head><body>
    <select id="se1" size="20">
    <option>鍙互閫夋嫨鐨勬按鏋?/option>
    <option>--------------</option>
    <option value="澶ч钑?>棣欒晧</option>
    <option value="澶ц嫻鏋?>鑻规灉</option>
    <option value="澶ф瀛?>姗樺瓙</option>
    <option value="澶х伀榫欐灉">鐏緳鏋?/option>
    </select><input type="button" value=" >> " id="Button1" >
     <input type="button" value=" >> " id="Button2" >
     <input type="button" value=" >> " id="Button3" >
     <input type="button" value=" >> " id="Button4" >
     
    <select id="se2" size="20">
    <option>鍙互閫夋嫨鐨勬按鏋?/option>
    <option>--------------</option>
    </select><script type="text/javascript">
      $(function() {
      $("#Button1").click(function() {
      $selceted = $("#se1 option:selected");
      $selceted.appendTo("#se2");  })  })
      $(function() {
      $("#Button2").click(function() {
      $selceted = $("#se2 option:selected");
      $selceted.appendTo("#se1");  })  })
      $(function() {
      $("#Button3").click(function() {
      $select = $("#se1 option").attr();
      $select.appendTo("#se2")       
      })
    })
    $(function() {
      $("#Button4").click(function() {
      $select = $("#se2 option").attr();
      $select.appendTo("#se1")
      })
    })</script>
    <select id="select1" size="20">
    <option>鍙互閫夋嫨鐨勬按鏋?/option>
    <option>--------------</option>
    <option value="澶ч钑?>棣欒晧</option>
    <option value="澶ц嫻鏋?>鑻规灉</option>
    <option value="澶ф瀛?>姗樺瓙</option>
    <option value="澶х伀榫欐灉">鐏緳鏋?/option>
    </select><input type="button" value=" >> " onclick="add()">
    <input type="button" value=" << " onclick="del()"><select id="select2" size="20">
    <option>鍙互閫夋嫨鐨勬按鏋?/option>
    <option>--------------</option>
    </select><script language="javascript">
    function add(){
    var select1 = document.getElementById("select1");
    var select2 = document.getElementById("select2");
    var select_index = select1.selectedIndex;if(select_index > 1){
    var option = document.createElement("option");//绗竴绉?
    // option.value = select1.options[select_index].value;
    // option.innerHTML = select1.options[select_index].innerHTML;
    // select2.appendChild(option);select2.options.add(new Option(select1.options[select_index].innerHTML, select1.options[select_index].value));//绗簩绉?select1.options[select_index] = null;
    }
    }function del(){
    var select1 = document.getElementById("select1");
    var select2 = document.getElementById("select2");
    var select_index = select2.selectedIndex;if(select_index > 1){
    var option = document.createElement("option");//绗竴绉?
    // option.value = select2.options[select_index].value;
    // option.innerHTML = select2.options[select_index].innerHTML;
    // select1.appendChild(option);select1.options.add(new Option(select2.options[select_index].innerHTML, select2.options[select_index].value));//绗簩绉?select2.options[select_index] = null;
    }
    }
    </script>
    </body>
    </html>参考