<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="Roger Chen">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body><select multiple size="12" name="list1">
<option value="A" selected>A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
<textarea name="list2" rows="5"></textarea><SCRIPT LANGUAGE="JavaScript">
<!--
var list = document.all('list1');
var memo = document.all('list2');for (var i = 0; i < list.options.length; i++) {
list2.value += list.options[i].value + '\n';
}
//-->
</SCRIPT>
</body>
</html>

解决方案 »

  1.   

    for (var intlop=0;intlop<=document.GetElementByName("list1").length-1;intlop++){
    document.GetElementByName("yourtxt").value=document.GetElementByName("yourtxt").value+document.GetElementByName("list1").options.item(intlop).value;
    }
    应该是这样写的
      

  2.   

    inelm(木野狐) :你的这个结果和我说的有些差别,我希望是先选择,再放到文本框中。
    如:我选了A,文本框中就出现A;再选了B,文本框中就出现B;再选了A,文本框中就出现了A...等等可能得做些修改吧
      

  3.   

    ffyd2000(卡拉永遠OK) :请问你有调试通过吗,你的这个好像也达不到我说的目的也!
      

  4.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
    <title> New Document </title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author" content="Roger Chen">
    <meta name="keywords" content="">
    <meta name="description" content="">
    </head>
    <body><select multiple size="12" name="list1" onclick="addOption()">
    <option value="A" selected>A</option>
    <option value="B">B</option>
    <option value="C">C</option>
    <option value="D">D</option>
    </select>
    <textarea name="list2" rows="5"></textarea><SCRIPT LANGUAGE="JavaScript">
    <!--
    function addOption() {
    var list = document.all('list1');
    var memo = document.all('list2');
    memo.value += list.options[list.selectedIndex].value + '\n';
    }
    //-->
    </SCRIPT>
    </body>
    </html>