您现在的位置:
主页
>
>学习园地
>>
网页制作特技
>>
带描述的下拉菜单
带描述的下拉菜单
学习园地
软件下载
税法查询
网址大全
把以下代码拷贝到HTML文件的HEAD部分:
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin function go_to_station() { if (document.stationform.stationselect.options[0].selected) { window.location.href = "http://go6.163.com/~zlk163/study.htm";} else if (document.stationform.stationselect.options[1].selected) { window.location.href = "http://go6.163.com/~zlk163/soft.htm";} else if (document.stationform.stationselect.options[2].selected) { window.location.href = "http://go6.163.com/~zlk163/tax.htm";} else if (document.stationform.stationselect.options[3].selected) { window.location.href = "http://go6.163.com/~zlk163/url.htm";} return true; } function textValue() { var stationInteger, stationString stationInteger=document.stationform.stationselect.selectedIndex stationString=document.stationform.stationselect.options[stationInteger].text document.stationform.stationtext.value = "欢迎进入" + stationString +"!" } // End --> </SCRIPT>
把以下代码拷贝到HTML文件的BODY部分:
<CENTER> <FORM name="stationform"> <SELECT name="stationselect" onChange="textValue()" multiple size="4"> <option>学习园地 <option>软件下载 <option>税法查询 <option>网址大全 </SELECT> <br> <p> <input type="button" name="stationbutton" value="Go!" onClick="go_to_station()"> <p> <input type="text" name="stationtext" value="" size="35" maxlength="35"> <p> </FORM> </CENTER>
top