How can I hide child div based on the attribute value of parent div. I have following markup:
<div class="offerContainer">
<div class="Offers" producttype="CIP">
<div class="buttons_wrap"></div>
</div>
<div class="Offers" producttype="P">
<div class="buttons_wrap"></div>
</div>
<div class="Offers" producttype="CIP">
<div class="buttons_wrap"></div>
</div>
</div>
And I want to hide buttons_wrap only when atrribute value of producttype is "CIP".
Something like:
if($(obj).parents(".offersContainer").find('.Offers').attr('producttype').value == "CIP")
$('.buttons_wrap').hide();