<table border=1>
<tr>
<td><input onclick="foo(this)"></td>
<td><input onclick="foo(this)"></td>
</tr>
<tr>
<td><input onclick="foo(this)"></td>
<td><input onclick="foo(this)"></td>
</tr>
</table>
<script type="text/javascript">
//<![CDATA[
var foo=function (o) {
while(o.tagName.toLowerCase()!="tr")
o=o.parentNode;
alert('第'+o.rowIndex+'行');
}
//]]>
</script>
<tr>
<td><input onclick="foo(this)"></td>
<td><input onclick="foo(this)"></td>
</tr>
<tr>
<td><input onclick="foo(this)"></td>
<td><input onclick="foo(this)"></td>
</tr>
</table>
<script type="text/javascript">
//<![CDATA[
var foo=function (o) {
while(o.tagName.toLowerCase()!="tr")
o=o.parentNode;
alert('第'+o.rowIndex+'行');
}
//]]>
</script>
<tr>
<td><input onclick="foo(this)">11111111</td>
<td><input onclick="foo(this)">222222</td>
</tr>
<tr>
<td><input onclick="foo(this)">33333333</td>
<td><input onclick="foo(this)">444444</td>
</tr>
</table>function foo(a){alert(a.parentNode.parentNode.rowIndex+1)
}