Link to home
Start Free TrialLog in
Avatar of paddycobbett
paddycobbett

asked on

jQuery: how to i grab elements of a certain depth?

Given the following html:

<div class='module'>
   <div id='a' class='element'>
      <div class='element'></div>
      <div class='element'></div>
   <div id='b' class='element'></div>
   <div>
      <div id='c' class='element'></div>
   </div>
</div>

What should the jquery selector look like in order to grab the first descendants of class "element", but not any of the descendants which have the class element. To clarify, the selector should return the elements with id a,b,c as assigned above.

$('.module .element:XXXX'); ???
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial