jquery :has check for images then apply css

Posted by sp-1986 on Stack Overflow See other posts from Stack Overflow or by sp-1986
Published on 2012-06-19T15:10:53Z Indexed on 2012/06/19 15:16 UTC
Read the original article Hit count: 159

Filed under:

If relatedProductsArea contains NO images then HIDE the div.

<div id="RelatedProductsArea" style="border-radius: 7px 7px 7px 7px;"><br clear="all"><div style="clear:both;"></div>
</div>

Finding NO images means there are no related products.

What i have tried:

$('#RelatedProductsArea').has('img').css('border', 'none');

Heres an example: http://jsfiddle.net/K2Cp6/

© Stack Overflow or respective owner

Related posts about jQuery