consider the following html structure:
<div>
<div class="top">
<div id="id1">123</div>
<div>
<div class="top">
<div id="id2">123</div>
<div>
</div>
Now I want to pick the container on the basis of class=”top” and id=”id2″ in such a way that i get the container with class top. How can I do that? I would like to have some selector for that.
P.S: the id i am looking for is not necessarily to be an immediate parent of the class top.
Is this what you’re looking for?
It will start with the ID and travel up until it finds the class top.