I want to add a class to a specific line, but the problem is that the line starts with number 0.
This is my code that I want to add only to the "0 BAM" class, but when I add this jQuery, it adds the class to all divs that have 0 and BAM, Like the first "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');
Thanks!
source
share