用下拉菜单跳转页面

来源:互联网 发布:淘宝网品牌女鞋kasscat 编辑:程序博客网 时间:2024/05/23 10:31

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用下拉菜单跳转页面</title>
<script language="javascript">
function getValue(){
var obj = document.getElementById("sel");
window.location.href="http://localhost/"+obj.options[obj.selectedIndex].value;
}
</script>
</head>
<body>
论坛跳转:
<form id="form1" name="form1" method="post" action="">
<select name="select" id="sel" onchange="getValue()">
    <option value="java.htm">java板块</option>
    <option value="delphi.htm">delphi板块</option>
    <option value="php.htm">php板块</option>
</select>
</form>
</body>
</html>

原创粉丝点击