Count how many divs has a specific content?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-29T17:22:38Z Indexed on 2010/04/29 17:27 UTC
Read the original article Hit count: 290

Filed under:
|

I want to count how many divs with the class .tool that contain the following html by 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 to do that using jQuery? i only can count all .tool divs?

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery