Yup that works, and this works too:             

$(this).parent().parent().next('tr.hidden').toggle(); 


Thanks a lot David !

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David 
Duymelinck
Sent: mardi 31 juillet 2007 9:08
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: traversing DOM question


Have you tried

$(document).ready(function(){
 
 $('.moreInfoLink').bind("click",function(){
  $(this).parents('tr').next('tr.hidden').toggle();
  return false;
 });
});

 From my experience i find parents more useful than parent because with the 
latter you have to be sure it is really the element you are after.


-- David


Alexandre Plennevaux schreef:
> hello friends,
>  
>  a quickie:  In my table, each table row contains  a div in the last 
> cell that, when click, should show()/hide() the very next TR.HIDDEN 
> element.
>  
> I tried this, but it does not work. I'm a bit confused on the use of 
> next() as you can see:
>  
> $(document).ready(function(){
>  
>  $('.moreInfoLink').bind("click",function(){
>   $(this).parent().next('tr.hidden').toggle();
>   return false;
>  });
> });
>  
>  
> can you tell me what i'm doing wrong?
>  
>  
> Thank you !
>  
> Alexandre
>

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.476 / Base de données virus: 269.11.0/927 - Date: 30/07/2007 17:02
 

Reply via email to