当前位置: 代码迷 >> JavaScript >> javascript兑现显示或隐藏
  详细解决方案

javascript兑现显示或隐藏

热度:23   发布时间:2012-10-08 19:54:56.0
javascript实现显示或隐藏
<head>
<script type="text/javascript">
function show(){
document.getElementById("hid").style.display=document.getElementById("hid").style.display==""?"none":"";
}
</script>
</head>
<body>
<a href="javascript:void()" onclick="show();">点击此按钮隐藏或显示</a>
<div id="hid" style="display:none">要隐藏的内容</div>
</body>
  相关解决方案