您的位置:首页 > 其它

div显示和隐藏

2015-08-22 14:39 225 查看
它是实现比较简单.style.display控制层隐藏或显示属性.

<html>
<body>
<script>
function show(){
document.getElementById("div").style.display="";
//alert(document.getElementById("div").style.display)
}
function hidden(){
document.getElementById("div").style.display="none";
//alert(document.getElementById("div").style.display)
}
</script>
<BODY>
<input name="name" type="button" onClick="show();" value="显示">
<div id="div" style="display: none" onMouseout="hidden();">
show it
</div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: