Reputation: 1048
I whant to add class on specific string but problem is that string starts with number 0.
This is my code I whant to add just on "0 BAM" class but when I add this Jquery he add class on all divs that have 0 and BAM, Like first one "290 BAM"
<div class="views-field-commerce-price"> 290 BAM</div>
<div class="views-field-commerce-price"> 0 BAM</div>
<div class="views-field-commerce-price"> 223 BAM</div>
<div class="views-field-commerce-price"> 490 BAM</div>
$('.views-field-commerce-price:contains("0 BAM")').addClass('item-3');
Thank You!
Upvotes: 4
Views: 163