gs97
<html>
<head>
<meta charset="gb2312">
<title>隐藏和显示</title>
<style type="text/css">
#thediv
{
 width:200px;
 height:100px;
 line-height:100px;
 text-align:center;
 
}
</style>
<script type="text/javascript">
function Show_Hidden(obj)
{
 if(obj.style.display=="block")
 {
  obj.style.display=\'none\';
 }
 else
 {
  obj.style.display=\'block\';
 }
}
window.onload=function()
{
 var olink=document.getElementById("link");
 var odiv=document.getElementById("thediv");
 olink.onclick=function()
 {
  Show_Hidden(odiv);
  return false;
 }
}
</script>
</head>
<body>
<a href="#" id="link">显示\隐藏切换</a>
<div id="thediv" style="display:block">脚本之家欢迎您</div>
</body>
</html>

分类:

技术点:

相关文章:

  • 2021-11-06
  • 2021-10-19
  • 2021-06-14
  • 2022-12-23
  • 2021-08-17
  • 2021-08-17
  • 2021-12-26
猜你喜欢
  • 2022-12-23
  • 2021-11-29
  • 2021-10-05
  • 2021-10-26
  • 2022-12-23
  • 2021-11-27
相关资源
相似解决方案