$(function(){ $('td').click(function() { var index = $(this).parents('tr').index(); alert(index) }) })