On Apr 16, 2009, at 8:26 AM, Dragon-Fly999 wrote:

Instead of using "$(this).parent().parent().find(':checkbox')", is
there a way to select using the following rule:
Go up the hierarchy (regardless of how many parents there are) until
the first <a> is found, then give me a list of all the checkboxes that
are the descendants of the <div> right after the <a>.

Unfortunately, given your markup, you can't do that, since <a> is not an ancestor of $(this). It's a previous sibling of one of the ancestor <div>s.

Leonardo's suggestion to give the wrapper div a class name is what I'd also suggest. You could then use .closest('div.wrapper') as he recommends, or .parents('div.wrapper:first')


--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com

Reply via email to