列表内容的选择
<HTML>
<HEAD>
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>列表内容的选择</TITLE>
</HEAD>
<BODY >
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
oldvalue = "";
function passText(passedvalue) {
if (passedvalue != "") {
var totalvalue = passedvalue+"\n"+oldvalue;
document.displayform.itemsbox.value = totalvalue;
oldvalue = document.displayform.itemsbox.value;
}
}
// End -->
</script>
<form name="selectform">
<select name="dropdownbox" size=1>
<option value="">请选择</option>
<option value="第一项">第一项</option>
<option value="第二项">第二项</option>
<option value="第三项">第三项</option>
<option value="第四项">第四项</option>
<option value="第五项">第五项</option>
<option value="第六项">第六项</option>
</select>
<input type=button value="添加到列表中" onClick="passText(this.form.dropdownbox.options[this.form.dropdownbox.selectedIndex].value);">
</form>
<form name="displayform" >
<font face="Arial, Helvetica, Sans Serif" size="3"><b>你可以自己选择一下:</b></font><br>
<textarea cols="30" rows="5" name="itemsbox" ></textarea>
</BODY></HTML>