- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head>
- <title>点击显示或隐藏</title>
- <style type="text/css">
- .dis{display:block;}
- .non{display:none;}
- </style>
- <script type="text/javascript">
- function f(oid){
- var d = document.getElementById(oid);
- if(d.className == "non")
- d.className = "dis";
- else
- d.className = "non";
- }
- </script>
- </head>
- <body>
- <div onclick="f('d1');">点击隐藏或显示</div>
- <div id="d1" class="non">显示或隐藏</div>
- </body>
- </html>
js小实例(显示或隐藏)
最新推荐文章于 2010-08-02 08:23:00 发布