I am using the rowIndex property of TR but it is not working. Please let me know if i am doing something wrong here.
function myMethod(){
alert ( this.parent.rowIndex ); // parentNode is also used
}
Html
<table border="1">
<tr>
<td onclick="myMethod();">1.1</td>
<td>1.2</td>
<td>1.3</td>
</tr>
<tr>
<td onclick="myMethod();">2.1</td>
<td>2.2</td>
<td>2.3</td>
</tr>
<tr>
<td onclick="myMethod();">3.1</td>
<td>3.2</td>
<td>3.3</td>
</tr>
<tr>
<td onclick="myMethod();">4.1</td>
<td>4.2</td>
<td>4.3</td>
</tr>
</table>