L@_@K
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body> <textarea id="ttaTarget" rows="5" cols="20">ab123
abc
1uyt</textarea> <select id="sltTest">
<option value="" selected="selected">-- Please Select --</option>
<option value="abcde">abcde</option>
</select>
<script type="text/javascript">
<!--
var oSlt = document.getElementById("sltTest");
oSlt.onchange = function()
{
if (this.value != "")
{
var oTta = document.getElementById("ttaTarget");
oTta.value += "\n" + this.value;
}
};
//-->
</script>
</body>
</html>
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body> <textarea id="ttaTarget" rows="5" cols="20">ab123
abc
1uyt</textarea> <select id="sltTest">
<option value="" selected="selected">-- Please Select --</option>
<option value="abcde">abcde</option>
</select>
<script type="text/javascript">
<!--
var oSlt = document.getElementById("sltTest");
oSlt.onchange = function()
{
if (this.value != "")
{
var oTta = document.getElementById("ttaTarget");
oTta.value += "\n" + this.value;
}
};
//-->
</script>
</body>
</html>
<textarea name="txt"></textarea>
<select id="s" onchange="document.all.txt.value+=this.value+'\n'">
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
</select>不过这样有什么意义吗~
在看到he_8134的帖子以前我已经结贴了,很抱歉。
你们两位的代码都work,非常感谢!