*********1***********
<TABLE border width="98%" οnclick="findcell()" id="tb1">
<TR>
<TD>1</TD>
<TD>2</TD>
</TR>
<TR>
<TD>3</TD>
<TD>4</TD>
</TR>
<TR>
<TD>5</TD>
<TD>6</TD>
</TR>
</TABLE>
<script>
function findcell()
{
var count=0;
for (i=0; i < document.all.tb1.rows.length; i++) {
for (j=0; j < document.all.tb1.rows(i).cells.length; j++) {
if(document.all.tb1.rows(i).cells(j)==event.srcElement)
{
alert("第"+(i+1)+"行"+"第"+(j+1)+"列")
}
}
}
}
</script>
**********2**********
<table border=1 width="100%" οnclick="test()">
<tr>
<td>²âÊÔ</td><td>²âÊÔ</td><td>²âÊÔ</td>
</tr>
<tr>
<td>²âÊÔ</td><td>²âÊÔ</td><td>²âÊÔ</td>
</tr>
<tr>
<td>²âÊÔ</td><td>²âÊÔ</td><td>²âÊÔ</td>
</tr>
<tr>
<td>²âÊÔ</td><td>²âÊÔ</td><td>²âÊÔ</td>
</tr>
</table>
<script>
function test()
{
var e = event.srcElement
while(e.tagName!="TR")
e=e.parentElement
alert(e.rowIndex)
}
</script>
**************3*****************
table border=1 width="100%" οnclick="test()">
<tr>
<td>测试</td><td>测试</td><td>测试</td>
</tr>
<tr>
<td>测试</td><td>测试</td><td>测试</td>
</tr>
<tr>
<td>测试</td><td>测试</td><td>测试</td>
</tr>
<tr>
<td>测试</td><td>测试</td><td>测试</td>
</tr>
</table>
<script>
function test()
{
var e = event.srcElement
while(e.tagName!="TR")
e=e.parentElement
alert(e.rowIndex)
}
</script>
<TABLE border width="98%" οnclick="findcell()" id="tb1">
<TR>
<TD>1</TD>
<TD>2</TD>
</TR>
<TR>
<TD>3</TD>
<TD>4</TD>
</TR>
<TR>
<TD>5</TD>
<TD>6</TD>
</TR>
</TABLE>
<script>
function findcell()
{
var count=0;
for (i=0; i < document.all.tb1.rows.length; i++) {
for (j=0; j < document.all.tb1.rows(i).cells.length; j++) {
if(document.all.tb1.rows(i).cells(j)==event.srcElement)
{
alert("第"+(i+1)+"行"+"第"+(j+1)+"列")
}
}
}
}
</script>
**********2**********
<table border=1 width="100%" οnclick="test()">
<tr>
<td>²âÊÔ</td><td>²âÊÔ</td><td>²âÊÔ</td>
</tr>
<tr>
<td>²âÊÔ</td><td>²âÊÔ</td><td>²âÊÔ</td>
</tr>
<tr>
<td>²âÊÔ</td><td>²âÊÔ</td><td>²âÊÔ</td>
</tr>
<tr>
<td>²âÊÔ</td><td>²âÊÔ</td><td>²âÊÔ</td>
</tr>
</table>
<script>
function test()
{
var e = event.srcElement
while(e.tagName!="TR")
e=e.parentElement
alert(e.rowIndex)
}
</script>
**************3*****************
table border=1 width="100%" οnclick="test()">
<tr>
<td>测试</td><td>测试</td><td>测试</td>
</tr>
<tr>
<td>测试</td><td>测试</td><td>测试</td>
</tr>
<tr>
<td>测试</td><td>测试</td><td>测试</td>
</tr>
<tr>
<td>测试</td><td>测试</td><td>测试</td>
</tr>
</table>
<script>
function test()
{
var e = event.srcElement
while(e.tagName!="TR")
e=e.parentElement
alert(e.rowIndex)
}
</script>