Rakesh Sawant
Rakesh Sawant

Reputation: 281

Jquery Selector select div with class having some title

I want to hide a div with class charts having title which contain (0%)

for example i have 5 div

<div class="charts" title ="book1 (0%)" ></div>

<div class="charts" title ="book2 (10%)" ></div>

<div class="charts" title ="book3 (20%)" ></div>

<div class="charts" title ="book4 (0%)" ></div>

<div class="charts" title ="book5 (0%)" ></div>

I am doing it with jquery but no luck

Please Help

Upvotes: 0

Views: 133

Answers (2)

Praveen Kumar Purushothaman
Praveen Kumar Purushothaman

Reputation: 167172

You can use jQuery's attribute equals selector:

$('.charts[title*="(0%)"]').hide();

Upvotes: 0

zerkms
zerkms

Reputation: 254906

$('div.charts[title*="(0%)"]').hide();

Upvotes: 3

Related Questions