<script language="javascript">
function moveText(){
var newtext=document.linkedListForm.cities.options[document.linkedListForm.cities.selectedIndex].text;
var opt=document.createElement("OPTION");
opt.text=newtext;
opt.value=newtext;
document.linkedListForm.newcity.options.add(opt);
}
</script>    html:  
<form name="linkedListForm">
<select name="cities">
   <option value="0">北京</option>
   <option value="1">上海</option>
</select><input type="button" name="move" value="移动" onclick="moveText()"><select name="newcity" size="10"><select>
</form>

解决方案 »

  1.   

    <table border=0 cellpadding=0 cellspacing=0><form name=meizz>
      <tr><td>
        <select id=list1 size=8 ondblclick="moveOption(this, this.form.list2)">
          <option value=A>aaaaaaaaaa
          <option value=B>bbbbbbbbbb
          <option value=C>cccccccccc
          <option value=D>dddddddddd
          <option value=E>eeeeeeeeee
          <option value=F>ffffffffff
          <option value=G>gggggggggg
          <option value=H>hhhhhhhhhh
        </select></td>
      <td width=40 align=center>
        <input name=add type=button value=">>>" onclick="moveOption(this.form.list1, this.form.list2)"><br><br>
        <input name=sub type=button value="<<<" onclick="moveOption(this.form.list2, this.form.list1)">
      </td><td>
        <select id=list2 size=8 ondblclick="moveOption(this, this.form.list1)">
        </select>
      </td></tr></form>
    </table><script language="JavaScript"><!--
    function moveOption(e1, e2){
        try{
            var e = e1.options[e1.selectedIndex];
            e2.options.add(new Option(e.text, e.value));
            e1.options.remove(e1.selectedIndex);
        }   catch(e){}
    }
    //--></script>
      

  2.   

    写得好简洁,不愧是高手,学习+抄袭先,xixi....
      

  3.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Page Selection</title>
    <style>
    td{white-space:nowrap};
    body{margin-left:0;margin-right:0;margin-top=0;margin-bottom=0};
    </style>
    </head><body bgcolor=eeeeee><table>
    <tr > 
    <td> 
    <select name=SrcSelect size=6 style="font-size:11pt;width=200;height=160px" multiple > 
    <option value="1">test1</option> 
    <option value="2">test2</option> 
    <option value="3">test3</option> 
    <option value="4">test4</option> 
    <option value="5">test5</option> 
    <option value="6">test6</option> 
    </select>
    </td> 
    <td align="center">    
    <input align="left" type=button value="→"  onclick="moveLeftOrRight(document.all.SrcSelect,document.all.ObjSelect)"  ><br><br>
    <input align="left" type=button value="←"  onclick="moveLeftOrRight(document.all.ObjSelect,document.all.SrcSelect)"  >
    </td>
    <td> 
    <select name=ObjSelect size=6 style="font-size:11pt;width=200;height=160px" multiple > 
    <option value="11">test11</option> 
    <option value="12">test12</option> 
    <option value="13">test13</option> 
    <option value="14">test14</option> 
    <option value="15">test15</option> 
    <option value="16">test16</option> 
    </select>
    </td> 
    <td>
    <input type=button value="↑"  onclick="moveUp()" ><br><br>
    <input type=button value="↓"  onclick="moveDown()" >
    </td>
    </tr> 
    </table>
    </body>  
      
    <script language=javascript>  
    function moveUp()  

    var theObj=document.all.ObjSelect;
    for(var i=1;i<theObj.length;i++)
    {
    if( theObj.options[i].selected && !theObj.options[i-1].selected )
    {
    theObj.options[i].swapNode(theObj.options[i-1]);
    }
    }
    }  
      
    function moveDown()  

    var theObj=document.all.ObjSelect;
    for(var i=theObj.length-2;i>-1;i--)
    {
    if( theObj.options[i].selected && !theObj.options[i+1].selected )
    {
    theObj.options[i].swapNode(theObj.options[i+1]);
    }
    }
    }  
      
      
    function moveLeftOrRight(fromObj,toObj)  
    {  
    var lengthOfToObj=toObj.length;
    for(var i=fromObj.length-1;i>-1;i--)
    {
    if(fromObj.options[i].selected)
    {
    toObj.add(new Option(fromObj.options[i].text,fromObj.options[i].value),lengthOfToObj);
    toObj.options[lengthOfToObj].selected=true;
    fromObj.options[i].removeNode(true);
    }
    }
    }  
      
      
     
    </script>  
      

  4.   

    <script language="javascript">
    var i=0;
    function moveText(){
    var index=document.all['cities'].selectedIndex;
    var newtext=document.linkedListForm.cities.options[index].text;
    var element = document.createElement("OPTION");
    document.linkedListForm.newcity.options.add(element);
    element.innerText=newtext;
    element.value=i;
    i++
    }
    </script>
    <form name="linkedListForm">
    <select name="cities">
       <option value="0">北京</option>
       <option value="1">上海</option>
    </select><input type="button" name="move" value="移动" onclick="moveText()"><select name="newcity" size="10">
    </select>
    </form>
      

  5.   

    谢谢上面各位,问题已经解决了。Thanks a lot!