126、两种下拉菜单打开

126、两种下拉菜单打开

脚本说明:

把如下代码加入<body>区域中

<script language="JavaScript">

function MM_o(selObj){

window.open(selObj.options[selObj.selectedIndex].value);}

</script>

 

<select onChange="MM_o(this)" name="select" >

<option selected>弹出窗口打开</option>

<option value="http://www.cctv.com">央视国际</option>

<option value="http://www.sina.com.cn">新浪网</option>

<option value="http://www.163.com">网易</option>

</select>

<script language="JavaScript">

<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0

eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

if (restore) selObj.selectedIndex=0;

}

//-->

</script>

<select onChange="MM_jumpMenu('parent',this,1)">

<option selected>在本窗口打开</option>

<option value="http://www.cctv.com">央视国际</option>

<option value="http://www.sina.com.cn">新浪网</option>

<option value="http://www.163.com">网易</option>

</select>

 

Write a comment

Comments: 0