Como mostrado abaixo:
Copie o código do código da seguinte forma:
<!
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" /> />
<title> Documento não -título </ititle>
<script type = "text/javascript">
Função copytolist (de, para) {
var delist = Eval ('document.forms [0].'+de);
var tolist = avaliar ('document.forms [0].'+para);
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') {{
Alerta ('Não é possível escolher este projeto!');
Retornar;
}
txt = current.text;
value = current.value;
tolist.options [tolist.length] = nova opção (txt, valor);
FromList.Options [i] = null;
eu ---;
}
}
if (! Sel) Alert ('Você ainda não escolheu nenhum projeto!');
}
function allSelect () {
var chsen = document.getElementById ('escolhido');
// Se a caixa de listagem Chsen for 0 ou o primeiro valor da opção for 'Temp'
if (chsen.length && chsen.opting [0]. value == "temp")
Retornar;
for (var i = 0; i <chsen.length; i ++) {
chsen.Options [i] .Select = true;
}
// Obtenha dados
Função getData () {
var lista = document.forms [0] .Rolelist;
// Obtenha um objeto de caixa de texto oculto
VAR POLESS = document.getElementById ("Trolelist");
fun.value = "";
var s = "";
if (list.length! = 0) {{
for (i = 0; i <list.length; i ++) {
s + = list.Option [i].
}
}
Fun.value = s;
}
}
</script>
</head>
<Body>
<Tabela>
<Form ansubMit = "allSelect ()">
<tr>
<Td>
<select name = "postible" size = "4" múltiplo>
<opção value = "1"> Guangzhou, China </pption>
<opção value = "2"> shanghai, China </pption>
<opção value = "3"> Pequim, China </pption>
<opção value = "4"> China Wuhan </pption>
</leclect>
</td>
<Td> <a href = "javascript: copyTolist ('possível', 'escolhido')"> adicione à direita-> <br>
<br>
</a> <a href = "javascript: copytolist ('escolhido', 'postible')"> <-Add à esquerda </a> </td>
<Td>
<select name = "escolhido" size = "4" múltiplo>
<opção value = "test"> selecione sua área na esquerda </pption>
</leclect>
</td>
</tr>
</morm>
</tabela>
<input type = "button" value = "submite" onclick = "allSelect ()" /> yle
<input type = "text" style = "display: nenhum;" id = "truelista">
</body>
</html>