文本框调用说明?高手帮帮我吧!!!

来源:百度知道 编辑:UC知道 时间:2024/06/14 18:03:01
<form name="stationform">
<div align="center">
<select name="stationselect" onChange="textValue()" multiple size="5">
<option>1
<option>2
<option>3
<option>4
</select>
<textarea class="solidinput" name="content" rows="4" cols="40" ></textarea>

<script>
var textdisplay=new Array()
textdisplay[0]="012"
textdisplay[1]="123"
textdisplay[2]="456"
textdisplay[3]="789"

function displaydesc(which){
if (document.all)
descriptions.innerHTML=textdisplay[which]
else if (document.getElementById)
document.getElementById("descriptions").innerHTML=textdisplay[which]
}

displaydesc(document.frm_supportticketadd.problem_type.selectedIndex)

<html>
<head>
<title>jsTest</title>
</head>
<body>
<form>
<select id="sel" onChange="textValue()">
<option value="012">1 </option>
<option value="123">2 </option>
<option value="456">3 </option>
<option value="789">4 </option>
</select>
<textarea id="txt"></textarea>
</form>

<script>
function textValue()
{
txt.value=sel.options[sel.selectedIndex].value;
}
</script>

</body>
</html>