I’ve done a few things such as selecting all children of an element, all parents of an element, first child etc.. but this is a little tricky.
I have the structure somewhat similar to this:
<div class="body">
<a href="something">Something</a>
<small>
<a href="something-else">Something-else</a>
</small>
</div>
and this structure is repeated a whole lotta times.
I need to select all <a> elements found only in the top level div.body and ignore all <a> that’s found in the <small> element.
How do I go around with this please?
thanks,.
Use the child selector:
A > Bmeans: “B is a immediate child of A”, whereasA Bmeans: `B is a (not strictly immediate) child of A.