zoukankan      html  css  js  c++  java
  • 超简单的javascript


    <!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 runat="server">
        <title>无标题页</title>

        <script language="javascript" type="text/javascript">
          lastDiv   =   'Basic'; 
        
         function   ShowDiv(id){          
              current   =   id; 
              if(lastDiv   &&   lastDiv   !=   current)  
                        document.getElementById(lastDiv).style.display   =   'none';  
              document.getElementById(current).style.display   =   'block';  
              lastDiv   =   current;  
     
        }

        </script>

    </head>
    <body>
            <div>
                <table>
                    <tr>
                        <td onclick="ShowDiv('Basic')">
                            1</td>
                        <td onclick="ShowDiv('bbb')">
                            2</td>
                        <td onclick="ShowDiv('ccc')">
                            3</td>
                        <td onclick="ShowDiv('ddd')">
                            4</td>
                    </tr>
                </table>
               
                <div id="Basic" >11111111111111111111111</div>
                <div id="bbb"  style="display:none;">22222222222222222222222</div>
                <div id="ccc" style="display:none;">33333333333333333333333</div>
                <div id="ddd" style="display:none;">44444444444444444444444</div>
            </div>
    </body>
    </html>

  • 相关阅读:
    C语言I博客作业07
    C语言I博客作业06
    C语言I博客作业05
    C语言I博客作业04
    C语言I博客作业02
    Django连接MySql数据库
    asyncio异步编程
    Django-rest framework框架
    Git版本管理工具详细教程
    MySQL的sql_mode模式说明及设置
  • 原文地址:https://www.cnblogs.com/xinlei/p/1756610.html
Copyright © 2011-2022 走看看