以下是select跳轉的三種方式
,希望對你們有幫助
第一種:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>select加鏈接</title>
</head>
<body>
<SCRIPT language=javascript>
<!--
// open the related site windows
function mbar(sobj) {
var docurl =sobj.options[sobj.selectedIndex].value;
if (docurl != "") {
open(docurl,'_blank');
sobj.selectedIndex=0;
sobj.blur();
}
}
//-->
</SCRIPT>
<Select οnchange=mbar(this) name="select">
<OPTION selected>=== 合作伙伴 ===</OPTION>
<OPTION value="http://www.choksun.com">創盛科技</OPTION>
<OPTION value="http://www.jinduo.com">金舵</OPTION>
<OPTION value="http://www.flash8.net/">閃吧</OPTION>
</Select>
</body>
</html>
第二種:
<select name="pageselect" οnchange="self.location.href=options[selectedIndex].value" >
<pre name="code" class="html"><OPTION value="http://www.choksun.com">創盛科技</OPTION>
<OPTION value="http://www.jinduo.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.choksun.com';
if(mylink.value == 1)
window.location='http://www.163.com';
if(mylink.value == 2)
window.location='http://www.sina.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="提交" οnclick="setsubmit(this)" />
</body>
</html>