比较简单实现.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>
div的显示和隐藏
时间: 2025-01-02 18:15:45