Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm rather busy trying to finish something without being sidetracked by yet another adventure in a new tech, so I'm taking the lazy approach.

The jQuery API browser lists these two selectors, but the parent child one never works when I think it will, but the descendent one does, and vice versa. What's the dope on these selectors?
Posted

1 solution

I'm no expert (in fact, I'm an ignoramus when it comes to jQuery), but ancestor and descendent would typically refer to parents of parents of parents (etc.) and children of children of children (etc.), respectively. So, child/parent are direct relations and ancestor/descendent are recursive.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900