Thank you both, it works :)
If the table is really big it might be better to use event delegation:
$('table').click(function(e){
var $td = $(e.target).closest('td'),
$tr = $td.parent(),
pos = $tr.children().index($td),
$up = $tr.prev().children().eq(pos),
$dn = $tr.next().children().eq(pos);
$up.c
Hi,
Assuming your table has the same number of s in each .
You can try this approach:
First find the position of the selected in its .
Then find the prev() or next() .
Then select the with the same position in that .
Try this:
$('td').click(function(){
var trparent = $(this).parent('tr')
3 matches
Mail list logo