[jQuery] Checking each div to see if it contains specific text
I have a list of container divs that have children. I want to check
for specific text in one child element, and if that is found, then
hide another child element. For some reason what I have is not
working:
$('.exhibition_item_body').each(function () {
if ($(this).children(".checkReception:contains('--:--:--')")) {
$(this).children('.reception').hide();
}
});
The divs look like:
<div class="exhibition_item_body">
<h3><a href="#">Jane Maxwell</a></h3>
<p class="checkReception" style="display: none;">2009-03-05 --:--:--</
p>
<p class="date">Mar 5 - Mar 31, 2009
<p class="reception" style="display: none;">Reception Mar 5, 2009 5 -
7 PM
<p class="location">San Francisco
<p class="exhibition_status">Previous Exhibition
</div>
<div class="clear"/>
</div>