I am using ‘live’ function to do some on-click stuff on table rows, i.e.
$("tr").live('click',function() {
alert('Some table row is clicked');
});
I want to find out which row is clicked and using if-else, give some custom alert based upon that. Can anyone tell me how to do it?
Thanks a lot.
EDIT 1:
Is there a way by which I can refer to the elements of the clicked row inside the function?
If you want to check which row number, use
index:Live demo
Update: