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>

  • 相关阅读:
    最长递增长度 (最长上升子序列)
    完全背包问题
    vue中使用el-tabs组件遇到的问题
    ORACLE中排序的时候空值处理
    ORA-01089数据库无法正常关闭
    Oracle中的LPAD和RPAD的使用
    Oracle中Translate函数的使用
    通过对照表快速建view
    Oracle数据库create or replace
    打字网站
  • 原文地址:https://www.cnblogs.com/xinlei/p/1756610.html
Copyright © 2011-2022 走看看