function showRowId(o){
var currentRowIndex=o.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rowIndex;
alert(currentRowIndex);
}
var $=function(id){
if(id && typeof id=="string"){
return document.getElementById(id);
}
}
<table id="A" border=1>
<tr>
<td>1</td>
</tr>
<tr>
<td >2</td>
</tr>
<tr>
<td >
<table id="B">
<tr>
<td>3</td>
</tr>
<tr>
<td>
<input id="btnTest" type="button" value="确定1" onclick="showRowId(this)">
</td>
</tr>
</table>
</td>
</tr>
</table>我放肆地说一句:楼主你那个HTML代码真的是乱!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货