• 点击消失


     1 <!doctype html>
     2 <html lang="en">
     3 <head>
     4     <meta charset="UTF-8">
     5     <title>Document</title>
     6     <style>
     7     ul
     8     {
     9         list-style: none;
    10 
    11     }
    12     #aa
    13     {
    14         width: 200px;
    15         height: 100px;
    16         background: pink;
    17     }
    18     ul #a
    19     {
    20         width: 200px;
    21         height: 500px;
    22         background: #3c3c3c;
    23     }
    24     </style>
    25 </head>
    26 <body>
    27     <ul>
    28         <li id="aa"></li>
    29         <li id="a"></li>
    30     </ul>
    31 
    32 
    33     <script>
    34     var chan1=document.getElementById('aa');
    35     var chan2=document.getElementById('a');
    36         chan1.onclick=function (){
    37             if (chan2.style.display=="block") {
    38                 chan2.style.display="none";
    39             }else{
    40                 chan2.style.display="block";
    41             };            
    42         };
    43 
    44     </script>
    45 </body>
    46 </html>
  • 相关阅读:
    寒假13
    寒假作业十二
    寒假12
    寒假作业十一
    寒假11
    寒假作业九
    寒假10
    寒假作业九
    寒假9
    寒假作业八
  • 原文地址:https://www.cnblogs.com/yoyoyoyoyoyo/p/5815500.html
Copyright © 2020-2023  润新知