<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<title>Insert title here</title>
<script language="javascript">
function lmenu(value){
switch(value){
case "新品":
submenu.innerHTML="<a href='#'>商品展示</a>|<a href='#'>销售排行榜</a>|<a href='#'>商品查询</a>";
break;
case "购物":
submenu.innerHTML="<a href='#'>添加商品</a>|<a href='#'>移出指定商品</a>|<a href='#'>清空购物车</a>|
<a href='#'>查询购物车</a>|
<a href='#'>填写订单信息</a>";
break;
case "会员":
submenu.innerHTML="<a href='#'>注册会员</a>|<a href='#'>修改会员</a>|<a href='#'>账户查询</a>";
break;
}
}
</script>
</head>
<body>
<table width="761" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="67" align="center"><a href="debug.php">首 页</a></td>
<td width="75" align="center"><a href="#"onmousemove="lmenu('新品')">新品上架</a></td>
<td width="75" align="center"><a href="#"onmousemove="lmenu('购物')">购物车</a></td>
<td width="74" align="center"><a href="#"onmousemove="lmenu('会员')">会员中心</a></td>
<td width="61" align="center"><a href="debug.php">在线帮助</a></td>
</tr>
<tr>
<div id="submenu" class="word_yellow"> </div>
</tr>
</table>
</body>
</html>
为什么不能显示子菜单?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<title>Insert title here</title>
<script language="javascript">
function lmenu(value){
switch(value){
case "新品":
submenu.innerHTML="<a href='#'>商品展示</a>|<a href='#'>销售排行榜</a>|<a href='#'>商品查询</a>";
break;
case "购物":
submenu.innerHTML="<a href='#'>添加商品</a>|<a href='#'>移出指定商品</a>|<a href='#'>清空购物车</a>|
<a href='#'>查询购物车</a>|
<a href='#'>填写订单信息</a>";
break;
case "会员":
submenu.innerHTML="<a href='#'>注册会员</a>|<a href='#'>修改会员</a>|<a href='#'>账户查询</a>";
break;
}
}
</script>
</head>
<body>
<table width="761" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="67" align="center"><a href="debug.php">首 页</a></td>
<td width="75" align="center"><a href="#"onmousemove="lmenu('新品')">新品上架</a></td>
<td width="75" align="center"><a href="#"onmousemove="lmenu('购物')">购物车</a></td>
<td width="74" align="center"><a href="#"onmousemove="lmenu('会员')">会员中心</a></td>
<td width="61" align="center"><a href="debug.php">在线帮助</a></td>
</tr>
<tr>
<div id="submenu" class="word_yellow"> </div>
</tr>
</table>
</body>
</html>
为什么不能显示子菜单?
解决方案 »
- 用javascript保存网页图片到本地的方法?
- 这段代码什么意思top.location=self.location;
- ExtJS从servlet获取值失败
- Javascript和JSON到底是什么关系?
- js菜鸟求问,在线等待
- json字符串问题
- 请问为什么innertext取出来的数据显示的是NaN啊,100分相送!!!!!!!!
- http://lucky.myrice.com/javascriptexam/htmleditor/editor/editor.htm 的编辑器数据获取问题
- 请问如何捕捉鼠标点击事件
- javascript怎么读取xml节点值,为什么我读取出来是null
- javascript返回值?
- SyntaxHihglighter 3 问题
//加下面這行
var submenu = document.getElementById("submenu");
+"<a href='#'>查询购物车</a>|"
+"<a href='#'>填写订单信息</a>";
你要换行就把字符串连接起来
代码在表格第二行写
<tr>
<div id="submenu" class="word_yellow"> </div>
</tr>
但是实际是子菜单在页面顶端输出,这是为什么呀?
<div id="submenu" class="word_yellow"> </div>
</td>
</tr>