zoukankan      html  css  js  c++  java
  • JavaScript修改表中的内容

    例子:

    <?php 
    ?>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <script>
          function modifyTableContent()
          {
              var obj = document.getElementById("tab1");
              obj.rows[1].cells[1].innerHTML = "zhuhai";  // 修改了第二行、第二列的内容
          }
      </script>
    </head>
    
    <body>
    <table id="tab1" width="445" border="1">
      <tr>
        <th width="68" scope="col">编号</th>
        <th width="42" scope="col">姓名</th>
        <th width="67" scope="col">登录名</th>
        <th width="49" scope="col">身份</th>
        <th width="85" scope="col">创建时间</th>
        <th width="94" scope="col">登录时间</th>
      </tr>
      <tr>
        <th width="68" scope="col">23</th>
        <th width="42" scope="col">Jack</th>
        <th width="67" scope="col">xman</th>
        <th width="49" scope="col">马甲</th>
        <th width="85" scope="col">09-11</th>
        <th width="94" scope="col">09-13</th>
      </tr>
    </table>
    <button style=" 60px; height:30px" onclick="modifyTableContent()"></button>
    </body>
    </html>
  • 相关阅读:
    bzoj 1087 状压dp
    HDU 5289 尺取
    HDU 1693 插头dp入门详解
    字符串操作
    河南省多校联萌(一)
    HDU 4815 概率dp,背包
    HDU4804 Campus Design (轮廓线DP)
    HDU 4828 逆元+catalan数
    HDU 5651 组合+逆元
    天才少年曹原的内心
  • 原文地址:https://www.cnblogs.com/Robotke1/p/3321261.html
Copyright © 2011-2022 走看看