[jQuery] finding closest ancestor matching a pattern

2007-03-05 Thread dalvarado
Hi, I am trying to find the closest ancestor whose id begins with childrenTOC. I am invoking the function within the onclick handler of the element with class toggleStrike. Previously, I was given this code $(this).parents([EMAIL PROTECTED]); but that seems to return an arrray of

Re: [jQuery] finding closest ancestor matching a pattern

2007-03-05 Thread John Resig
One simple addition: $(this).parents([EMAIL PROTECTED]:first); That'll give you the closest one. --John On 3/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I am trying to find the closest ancestor whose id begins with childrenTOC. I am invoking the function within the onclick