显示 隐藏 菜单

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="JavaScript">
function show(ChildMenu1){
if (ChildMenu1.style.display == "none") {
ChildMenu1.style.display = "";
button1.value="隐藏"
}else{
ChildMenu1.style.display = "none";
button1.value="显示"
}
}
</script>
</head>

<body>
<input type="button" value="显示" id="button1" onclick="show(ChildMenu1)">
<ul style="display:none" id="ChildMenu1">
<li>子菜单</li>
<li>子菜单</li>
<li>子菜单</li>
</ul>
</body>
</html>

posted on 2014-08-28 14:29  moliwanzi  阅读(161)  评论(0编辑  收藏  举报

导航