<!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" /> <title>无标题文档</title> </head> <script language="javascript"> function change(sel1,sel2){ var s1=document.getElementById(sel1) var s2=document.getElementById(sel2) for(var i=s1.options.length-1;i>=0;i--){ if(s1.options[i].selected){ s2.options.add(new Option(s1.options[i].text,s1.options[i].value)) s1.options.remove(i); } } } </script> <body> <div style="float:left; width:50px; height:30px;"> <select multiple="multiple" id="s1"> <option value="00">00t</option> <option value="11">11t</option> <option value="22">22t</option> </select> </div> <div style="float:left; width:40px; height:30px;"> <input type="button" value=">" onclick="change(‘s1‘,‘s2‘)" /><br /><br /> <input type="button" value="<" onclick="change(‘s2‘,‘s1‘)" /> </div> <div style="float:left; width:50px; height:30px;"> <select multiple="multiple" id="s2"> </select> </div> </body> </html>
时间: 2024-11-09 02:22:57