代码片段如下:
<script language="javascript" type="text/javascript">
<!--
function setVar(v_sel){
document.form0.txta1.value = v_sel.value;
}
//-->
</script>
<form name="form0" method="post" action="">
<select name="sel1" id="sel1" onchange="setVar(this);">
<option value="南京1111">南京</option>
<option value="北京2222">北京</option>
<option value="东京3333">东京</option>
</select>
<textarea id="txta1" name="txta1"></textarea>
</form>
下面是一套更好的写法!
<form name="form0" method="post" action="">
<select name="huoquneirong" id="huoquneirong">
<option value="获取1" data-writetext="内容说明1">获取1</option>
<option value="获取2" data-writetext="内容说明2">获取2</option>
<option value="获取3" data-writetext="内容说明3">获取3</option>
<option value="获取4" data-writetext="内容说明4">获取4</option>
<option value="获取5" data-writetext="内容说明5">获取5</option>
</select>
<textarea id="shuoming" ></textarea>
</form>
<script src="/skin/choudaima/js/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("#huoquneirong").change(function(){
var Temp = $("#huoquneirong option:selected").data("writetext")
$("#shuoming").html(Temp);
})
})
</script>