以下に示すように:
次のようにコードコードをコピーします。
<
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<メタhttp-equiv = "content-type" content = "text /html; charset = utf-8" /> />
<Title>非文書</title>
<script type = "text/javascript">
関数copyTolist(from、to){
var fromList = eval( 'document.forms [0]。'+from);
var tolist = eval( 'document.forms [0]。'+to);
if(tolist.options.length> 0 && tolist.options [0]。value == 'temp'){
tolist.options.length = 0;
}
var sel = false;
for(i = 0; i <teomlist.options.length; i ++){
var current = fromList.options [i];
if(current.select){
sel = true;
if(current.value == 'temp'){{
アラート( 'このプロジェクトを選択できません!');
戻る;
}
txt = current.text;
value = current.value;
tolist.options [tolist.length] = new option(txt、value);
fromList.options [i] = null;
私 - -;
}
}
if(!sel)alert( 'まだプロジェクトを選択していない!');
}
function allselect(){
var chsen = document.getElementById( 'chosen');
// chsenリストボックスが0の場合、または最初のオプション値が「温度」の場合
if(chsen.length && chsen.opting [0]。value== "temp")
戻る;
for(var i = 0; i <chsen.length; i ++){
chsen.options [i] .select = true;
}
//データを取得します
関数getData(){
var list = document.forms [0] .rolelist;
//非表示のテキストボックスオブジェクトを取得します
var choles = document.getElementById( "Trolelist");
loles.value = "";
var s = "";
if(list.length!= 0){{
for(i = 0; i <list.length; i ++){
s + = list.option [i]。
}
}
role.value = s;
}
}
</script>
</head>
<body>
<表>
<form onsubmit = "allselect()">
<tr>
<td>
<name = "posible" size = "4"倍数>を選択します
<オプション値= "1">広州、中国</option>
<オプション値= "2">上海、中国</option>
<オプション値= "3">北京、中国</option>
<オプション値= "4">中国wuhan </option>
</select>
</td>
<td> <a href = "javascript:copytolist( 'copide'、 'chosen')">右に追加 - > <br>
<br>
</a> <a href = "javascript:copytolist( 'chosen'、 'posible')"> <-add </a> </td>
<td>
<name = "chosen" size = "4"倍数>を選択します
<オプション値= "test">左から領域を選択</option>
</select>
</td>
</tr>
</form>
</table>
<入力型= "button" value = "submit" onclick = "allselect()" /> yle
<input type = "text" style = "display:none;" "truelist">
</body>
</html>