I want to hide divs which has attribute show-value equal to 0. Something like this:
<div class="card-tag card-product-new-tag" show-value="0">NEW</div>//this should be hidden
<div class="card-tag card-product-new-tag" show-value="1">NEW</div>//this should be visible
Html:
<div class="card-product">
<img class="card-product-img" src="somewhere1">
<img class="card-product-img2" src="somewhere2">
<div class="card-tag card-product-new-tag" show-value="0">NEW</div>
<div class="card-tag card-product-sale-tag" show-value="1">SALE</div>
<div class="card-tag card-product-popular-tag" show-value="1">POPULAR</div>
<div class="card-tag card-product-featured-tag" show-value="1">FEATURED</div
<div class="card-product-name"><a href="">Product Title</a></div>
<div class="card-product-price">99TL</div>
</div>
<div class="card-product">
<img class="card-product-img" src="somewhere1">
<img class="card-product-img2" src="somewhere2">
<div class="card-tag card-product-new-tag" show-value="1">NEW</div>
<div class="card-tag card-product-sale-tag" show-value="1">SALE</div>
<div class="card-tag card-product-popular-tag" show-value="1">POPULAR</div>
<div class="card-tag card-product-featured-tag" show-value="1">FEATURED</div
<div class="card-product-name"><a href="">Product Title</a></div>
<div class="card-product-price">99TL</div>
</div>
jQuery:
if ($(".card-product .card-product-new-tag").attr("show-value") == 0){
$(".card-product .card-product-new-tag", this).hide();
}