This article mainly introduces a simple example of how to move up, down, move left, and move right in the listbox implementation. Need friends can come to the reference, I hope to help you.
Code as follows: <html> <head> <title>javascript version select Pull-down menu to move and sort </title> & nbsp <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 > </head> <body> <p> Select one or more items and then click Add or Remove (hold down SHIFT or CTRL to select more). or double-click on the selection to add and remove. </p> <form method= "POST" name= "MyForm" > <table border= "0" width= "" > &nbs P <tr> <TD width= "40%" > &NBS P <select style= "width:100px; height:200px "Multiple name=" List1 "size=" "ondblclick=" Moveoption (Document.myform.list1, Document.myform.list2) " > <option value= "Beijing" > Beijing </option> &nbs P <option value= "Shanghai" > Shanghai </option> &N Bsp &NBSP <option value= "Shandong" > Shandong </option> &N Bsp <option value= "Anhui" > Anhui </option> &L T;option value= "Chongqing" > Chongqing </option> <option Value= "Fujian" > Fujian </option> <option value= "Gansu "> Gansu </option> <option value=" Guangdong "> Guangdong &L t;/option> <option value= "Guangxi" > Guangxi </option > <option value= "Guizhou" > Guizhou </option> &nbs P <option value= "Hainan" > Hainan </option> &N Bsp   <option value= "Hebei" > Hebei </option> &N Bsp <option value= "Heilongjiang" > Heilongjiang </option> <option value= "Henan" > Henan </option> &N Bsp <option value= "Hubei" > Hubei </option> <optio n value= "Hunan" > Hunan </option> <option value= " Inner Mongolia "> Inner Mongolia </option> <option value=" Jiangsu "> Jiangsu </option> <option value= "Jiangxi" > Jiangxi </op tion> <option value= "Jilin" > Jilin </option>   <option value= "Liaoning" > Liaoning </option> &N Bsp <option value= "Ningxia" > Ningxia </option> &N Bsp <option value= "Qinghai" > Qinghai </option> &N Bsp <option value= "Shanxi" > Shanxi </option> &N Bsp <option value= "Shaanxi" > Shaanxi </option> <optio n value= "Sichuan" > Sichuan </option> <option value= " Tianjin "> Tianjin </option> <option value=" Tibet "> Tibet </option> <option value= "Xinjiang" > Xinjiang </option> <option value= "Yunnan" > Yunnan </option> <option value= "Zhejiang" > Zhejiang </option> &N Bsp <option value= "Hong Kong" > Hong Kong </option> &N Bsp <option value= "Macau" > Macau </option> &N Bsp <option value= "Taiwan" > Taiwan </option> &N Bsp <option value= "Other" > Other </option> </sele ct> </td> <TD width= "20%" align= "center" > <input type= "button" value= ">>" onclic K= "MOveoption (Document.myform.list1, document.myform.list2) "><br/> <br/> <input type= "button" value= "<< "Onclick=" Moveoption (Document.myform.list2, Document.myform.list1) "> < /TD> <TD width= "40%" > <select style= "width:100px; height:200px "Multiple name=" List2 "size=" "ondblclick=" Moveoption (Document.myform.list2, Document.myform.list1) " > </select> ;/td> <td> < Button onclick= "Changepos (list2,-1)" type= "button" > &NBS P∧</button> <br/> & nbsp <button onclick= "Changepos (list2,1)" type= "button" > & nbsp ∨</button> </td> </TR&G T </table> value: <input type= "text" name= "City" size= "" "> </form> nbsp <script language= "JavaScript" > <!-- function moveoption (E 1, E2) { try { for (var i = 0; i < e1.options.length; i++) { if (e1.options[i].selected) { & nbsp var e = e1.options[i];   E2.options.add (new Option (E.text, E.value)); e1.remove (i); i = i-1 Document.myform.city.value = GetValue (DOCUMENT.MYFORM.LIST2); catch (e) {} & nbsp } function GetValue (geto) { var allvalue = "" ; for (var i = 0; i < geto.options.length i++) { & nbsp Allvalue + + Geto.options[i].valUE + ","; return allvalue; } function changepos (obj, index) { &NB Sp if (index = 1) { if (Obj.selectedindex > 0) {& nbsp obj.options (obj.selectedindex) SwapNode (Obj.options ( obj.selectedindex-1) { &NBSP ; } ELSE if (index = 1) { if (Obj.selectedindex < obj.options.length-1) { &NBSP ; Obj.options (Obj.selectedindex). SwapNode (Obj.options (Obj.selectedindex + 1)) & nbsp } } } //--> </SCRIPT&G T </body> </html>