我查了一下,大多数是在tr的onclick时间定义的
我现在要做的是
其中在列9是一个按钮,我想按下这个按钮获取tr的行数.列1  列2  ...... 列9
你好 ok          按钮

解决方案 »

  1.   

    rowIndexL@_@K
    <!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>
      <title> new document </title>
      <meta name="generator" content="editplus" />
      <meta name="author" content="" />
      <meta name="keywords" content="" />
      <meta name="description" content="" />
     </head> <body>
      <table>
    <tr>
    <td>1</td>
    <td>a</td>
    <td>x</td>
    <td><input type="button" value="show row index" onclick="alert(this.parentNode.parentNode.rowIndex);" /></td>
    </tr>
    <tr>
    <td>2</td>
    <td>b</td>
    <td>y</td>
    <td><input type="button" value="show row index" onclick="alert(this.parentNode.parentNode.rowIndex);" /></td>
    </tr>
    <tr>
    <td>3</td>
    <td>c</td>
    <td>z</td>
    <td><input type="button" value="show row index" onclick="alert(this.parentNode.parentNode.rowIndex);" /></td>
    </tr>
      </table>
     </body>
    </html>
      

  2.   

    Web 开发常用手册JScript语言参考.rar
    http://download.csdn.net/source/308916DHTML参考手册.rar
    http://download.csdn.net/source/308913样式表中文手册.chm
    http://download.csdn.net/source/304124