This is my HTML...
$("table tr button").on('click', function(e) {
var i = $(this).closest('td').parent()[0].sectionRowIndex;
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table class="tab">
<tr>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
</tr>
<tr>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
<td><button class="button"></button></td>
</tr>
</table>
I was trying to get the index of clicked button.
But I am getting an error...please somebody tell me how to do this.