日常小记

Html5 select 下拉列表点击跳转

跳转菜单html代码如下:

<form action="" method="get">
<label>2、跳转的下拉列表菜单</label>
<select name="jumpMenu" id="jumpMenu"
onchange="MM_jumpMenu('parent',this,0)">
<option value="http://www.DIVCSS5.com/";>DIVCSS5</option>
<option value="http://www.divcss5.com/";>DIVCSS5</option>
</select>
</form>

实现跳转还需要在head标签内加入Js脚本动作代码:

<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>

回复 / 取消回复

  1. 啦啦啦 啦啦啦
    Chrome 78

    期望出个博客搭建教程

  2. Ye Ye Ye Ye
    Chrome 72 10

    ???

  3. b a b a b a b a
    Chrome 78 10

    写得好

This is just a placeholder img.