Reputation: 1809
I have several divs in my variable offers
and I want to retrieve the one with class special
. How can I find that element? Or apply selector on variable offers
?
For Example offers contain:
<div class="special">A</div>
<div class="notspecial">B</div>
<div class="notspecial">C</div>
<div class="special">D</div>
Upvotes: 1
Views: 61
Reputation: 82251
You can use .filter()
function to filter out elements based on condition in returned set:
var splofferelements = offers.filter('.special')
Upvotes: 2