select下拉选框加链接实现选中跳转, select下拉框实现选中跳转的几种方法
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>select加链接实现选中跳转</title></head><body><SCRIPT language=javascript><!--// open the related site windowsfunction mbar(sobj) {var docurl =sobj.options[sobj.selectedIndex].value;if (docurl != "") { open(docurl,'_blank'); sobj.selectedIndex=0; sobj.blur();}}//--></SCRIPT><Select onchange=mbar(this) name="select"><OPTION selected>=== 合作伙伴 ===</OPTION><OPTION value="http://www.baidu.com">百度</OPTION><OPTION value="http://www.163.com">网易</OPTION><OPTION value="http://www.tao2t.net/">淘书城</OPTION></Select></body></html>
<select name="pageselect" onchange="self.location.href=options[selectedIndex].value" ><OPTION value="http://www.baidu.com">百度</OPTION><OPTION value="http://www.163.com">网易</OPTION></select>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>select选择-然后点击按钮跳转</title><script type="text/javascript">function setsubmit(){if(mylink.value == 0)window.location='http://www.baidu.com';if(mylink.value == 1)window.location='http://www.163.com';if(mylink.value == 2)window.location='http://www.1357vip.com';}</script></head><body><select name="mylink" id="mylink"><OPTION value="0">百度</OPTION><OPTION value="1">网易</OPTION><OPTION value="2">世界之最</OPTION></select><input type="button" id="btn" value="提交" onclick="setsubmit(this)" /></body></html>
完成。
新闻热点
疑难解答