新用户注册恢复喜悦村十周年

``救命啊!!!

  1. <html>
  2.         <head>
  3.                 <title>Test</title>
  4.                 <script language='javascript'>
  5.                         function c()
  6.                         {
  7.                                 this.box = document.createElement('div');
  8.                                 this.box.className = 'box';
  9.                                 this.box.onclick = cc;
  10.                                 this.box.modObj = this;
  11.                                 var b = document.getElementsByTagName('body')[0];
  12.                                 b.appendChild(this.box);
  13.                         }
  14.                         function cc()
  15.                         {
  16.                                 this.modObj.box.style.display = 'none';
  17.                         }
  18.                 </script>
  19.             <style type="text/css">
  20. <!--
  21. .box {
  22.         background-color: #DEEEFE;
  23.         height: 100px;
  24.         width: 100px;
  25.         border: 1px dashed #0066FF;
  26. }
  27. -->
  28.         </style>
  29. </head>
  30.         <body>
  31.         <input type='button' onclick='c()' value='Click'></input>
  32.         </body>
  33. </html>
复制代码
生成后       每次只能隐藏一个     怎么能让点一个隐藏一个  看了半天就是看不出来 问题   
                   帮帮小弟 啊!  急啊!!!!
[php]
<html>
        <head>
                <title>Test</title>
                <script language='javascript'>
                                var i=0;
                        function c()
                        {
                                var box = document.createElement('div');
                                                                var b = document.getElementsByTagName('body')[0];
                                box.className = 'box';
                                                                box.innerText=i;
                                box.onclick = cc;
                                b.appendChild(box);
                                                                i++;
                        }
                        function cc()
                        {
                                this.style.display = 'none';
                        }
                </script>
            <style type="text/css">
<!--
.box {
        background-color: #DEEEFE;
        height: 100px;
        width: 100px;
        border: 1px dashed #0066FF;
}
-->
        </style>
</head>
        <body>
        <input type='button' value='Click' onclick="c();"></input>
        </body>
</html>
[/php]
学会用下半身来思考!