让所有的层都隐藏 document.getElementsByTagName("div")obj.currentStyle.position=="absolute"||obj.currentStyle.position=="relative"obj.style.visibility="hidden" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 简单 <body style="display: none"> 黄容的方法是不是把body里的所有元素都隐藏了?? function hidden(divName){divName.style.display = 'none';}<div style="display:''" id="key">所有要隐藏的东西</div><input type="button" onClick="javascript:hidden(key)"> <script language="JavaScript" type="text/JavaScript">function test(){ var divs = document.getElementsByTagName("div") for(i=0;i<divs.length;i++) divs[i].style.display="none"}</script><input type="button" name="Button" value="Button" onClick="test()"><div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1; background-color: #FF0000; layer-background-color: #FF0000; border: 1px none #000000;">1111111111111111</div><div id="Layer2" style="position:absolute; width:200px; height:115px; z-index:2; left: 407px; top: 21px; background-color: #0000CC; layer-background-color: #0000CC; border: 1px none #000000;">2222222</div><div id="Layer3" style="position:absolute; width:200px; height:115px; z-index:3; left: 150px; top: 219px; background-color: #009900; layer-background-color: #009900; border: 1px none #000000;">2222</div> 现在用js还能屏蔽alt+f4吗? 如何得到没有初始值的div的style.top? 我的到的都是0,可是div明明在中间 工作选择 求助,for..in使用出错,在使用中有什么要注意的? 获得动态生成DIV的高度,宽度,求助高手,在线等~~~~ 响应无序列表的点击事件 问个问题,关于判断iframe里面页面的高度 请问,在javascript中如何释放内存? 关于自动提交表单 请教一个出错信息的解决办法? 类似QQ的菜单 键值捕获
{
divName.style.display = 'none';
}<div style="display:''" id="key">
所有要隐藏的东西
</div>
<input type="button" onClick="javascript:hidden(key)">
function test()
{
var divs = document.getElementsByTagName("div")
for(i=0;i<divs.length;i++)
divs[i].style.display="none"
}
</script>
<input type="button" name="Button" value="Button" onClick="test()">
<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1; background-color: #FF0000; layer-background-color: #FF0000; border: 1px none #000000;">1111111111111111</div>
<div id="Layer2" style="position:absolute; width:200px; height:115px; z-index:2; left: 407px; top: 21px; background-color: #0000CC; layer-background-color: #0000CC; border: 1px none #000000;">2222222</div>
<div id="Layer3" style="position:absolute; width:200px; height:115px; z-index:3; left: 150px; top: 219px; background-color: #009900; layer-background-color: #009900; border: 1px none #000000;">2222</div>