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> <p class="reception" style="display: none;">Reception Mar 5, 2009 5 - 7 PM</p> <p class="location">San Francisco</p> <p class="exhibition_status">Previous Exhibition</p> </div> <div class="clear"/> </div>