Count how many divs have specific content?
I want to count how many divs with a class .tool
that contain the following html, for example:<b>Photoshop</b>
<div class="tool"><b>After Effects</b></div>
<div class="tool"><b>Photoshop</b></div>
<div class="tool"><b>Illustrator</b></div>
<div class="tool"><b>Photoshop</b></div>
<div class="tool"><b>Photoshop</b></div>
// This would return 3
How can I do this with jQuery? Can I count only .tool
divs?
thanks
+2
a source to share
2 answers