<html>
<head>
<title></title>
<script type=text/javascript>
function getselect(n){
var v = '';
var t = '';
for(var i = 0; i < n.options.length; i++){
if(i==0){
t = n.options[i].id;
v = n.options[i].value;
}else{
t += ','+n.options[i].id;
v += ','+n.options[i].value;
}
}
alert(v+'|'+t);
}
function getmove(e1,e2){
for(var i=0;i<e1.options.length;i++){
if(e1.options[i].selected){
var e = e1.options[i];
e2.options.add(new Option(e.text, e.value));
e1.remove(i);
i=i-1;
}
}
}
</script>
</head>
<body>
<table>
<form name="form1">
<tr>
<td>
<select name="n1" id="n1">
<option value='1' id="a">项目1</option>
<option value='2' id="b">项目2</option>
<option value='3' id="c">项目3</option>
<option value='4' id="d">项目4</option>
<option value='5' id="e">项目5</option>
</select>
</td>
<td>
<select name="n2" id="n2">
</select>
</td>
</tr>
<tr>
<td><a οnclick="getselect(document.form1.n1)" href="#">获取</a></td>
<td><a οnclick="getmove(document.form1.n1,document.form1.n2)" href="#">转移</a></td>
</tr>
</form>
</table>
<body>
</html>
<head>
<title></title>
<script type=text/javascript>
function getselect(n){
var v = '';
var t = '';
for(var i = 0; i < n.options.length; i++){
if(i==0){
t = n.options[i].id;
v = n.options[i].value;
}else{
t += ','+n.options[i].id;
v += ','+n.options[i].value;
}
}
alert(v+'|'+t);
}
function getmove(e1,e2){
for(var i=0;i<e1.options.length;i++){
if(e1.options[i].selected){
var e = e1.options[i];
e2.options.add(new Option(e.text, e.value));
e1.remove(i);
i=i-1;
}
}
}
</script>
</head>
<body>
<table>
<form name="form1">
<tr>
<td>
<select name="n1" id="n1">
<option value='1' id="a">项目1</option>
<option value='2' id="b">项目2</option>
<option value='3' id="c">项目3</option>
<option value='4' id="d">项目4</option>
<option value='5' id="e">项目5</option>
</select>
</td>
<td>
<select name="n2" id="n2">
</select>
</td>
</tr>
<tr>
<td><a οnclick="getselect(document.form1.n1)" href="#">获取</a></td>
<td><a οnclick="getmove(document.form1.n1,document.form1.n2)" href="#">转移</a></td>
</tr>
</form>
</table>
<body>
</html>