<html>
<head>
<SCRIPTLANGUAGE="JavaScript">
<!--Begin
varmessages=newArray();
messages[0]="";//这里写入每个选项对应的说明文字
messages[1]="https://www.jb51.net";
messages[2]="http://www.163.com";
messages[3]="http://cn.yahoo.com";
//根据需要,这里应该随着选项的改变而增减项目
functionmessageReveal(){
varmessageindex=document.messageForm.messagePick.selectedIndex;
//取得当前下拉菜单选定项目的序号
helpmsg=messages[messageindex];
//根据序号取得当前选项的说明
document.messageForm.messageField.value=helpmsg
//将说明写进文框
}
//End-->
</SCRIPT>
<title>下拉菜单和文本框构建的介绍栏</title>
</head>
<body>
<formname="messageForm">
<selectname="messagePick"OnChange="messageReveal()">
<optionvalue="0">请在这里选择需要咨询的信息
<option>脚本之家
<option>网易163
<option>中文雅虎
</select>
<br><br><br><br><br>
<inputname="messageField"type="text"style="overflow:auto"/>
</form>
</body>
</html>
|