JS option location 页面跳转实现代码
程序员文章站
2022-06-29 09:05:10
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<title>跳转菜单</title>
<script language="javascript">
function jump()
{
location.href=document.myform.menu1.value;
}
</script>
</head>
<body>
<form name="myform">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><img src="d:\1.jpg" width="190" height="151" border="0"></td>
<td><img src="d:\2.jpg" width="200" height="150" border="0"></td>
</tr>
<tr>
<td><img src="d:\3.jpg" width="188" height="150" border="0"></td>
<td><img src="d:\4.jpg" width="200" height="150" border="0"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right">跳转到九寨沟</td>
<td>
<select name="menu1" onchange="jump()">
<option>---请选择季节景色---</option>
<option value="spring.htm">春天美景</option>
<option value="summer.htm">夏天一色</option>
<option value="autumn.htm"> 秋天枫叶</option>
<option value="winter.htm">冬天白雪</option>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<title>跳转菜单</title>
<script language="javascript">
function jump()
{
location.href=document.myform.menu1.value;
}
</script>
</head>
<body>
<form name="myform">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><img src="d:\1.jpg" width="190" height="151" border="0"></td>
<td><img src="d:\2.jpg" width="200" height="150" border="0"></td>
</tr>
<tr>
<td><img src="d:\3.jpg" width="188" height="150" border="0"></td>
<td><img src="d:\4.jpg" width="200" height="150" border="0"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right">跳转到九寨沟</td>
<td>
<select name="menu1" onchange="jump()">
<option>---请选择季节景色---</option>
<option value="spring.htm">春天美景</option>
<option value="summer.htm">夏天一色</option>
<option value="autumn.htm"> 秋天枫叶</option>
<option value="winter.htm">冬天白雪</option>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>
上一篇: 小儿湿疹吃什么好,妈妈别担心
下一篇: 枇杷的营养价值及吃法,今天告诉你