<script type="text/javascript">



                function delcte(){

        if(document.getElementById("checkid").checked //这里我想拿到选中的那行Tr的行号
        Mytable.deleteRow(1);    //然后再这里就可以删除了


}
javascriptcheckbox

解决方案 »

  1.   

    操作dom试试  this.parentNode.parentNode获取多选框所在的那个tr
      

  2.   

    把行号 绑定在 checkbox上     <input type="checkbox" value="行号" />
    document.getElementById("checkid").value
      

  3.   

    <!DOCTYPE html>
    <html>
    <head>
     
    <script>
     function getRowIndex(e){
     
    alert(e.parentNode.parentNode.rowIndex);}
    </script>
    </head>
    <body>
    <table>
    <tr>
     <td><input type="checkbox" value="1" onClick="getRowIndex(this)"/><td>
     <td>ffff</td>
    <td>vvvvv</td>
    </tr>
    <tr>
     <td><input type="checkbox" value="2" onClick="getRowIndex(this)"/><td>
     <td>ffff</td>
    <td>vvvvv</td>
    </tr>
    <tr>
     <td><input type="checkbox" value="3" onClick="getRowIndex(this)"/><td>
     <td>ffff</td>
    <td>vvvvv</td>
    </tr>
    <table>
     
    </body>
    </html>