Html code
<div class="add_pdt_img_nc">
<h5>Additional Images</h5>
<img border="0" src="" alt="">
<img border="0" src="" alt="">
<img border="0" src="" alt="">
<img border="0" src="" alt="">
</div>
i want to remove div has class add_pdt_img_nc if all image src is null
i have tried so far
$(".add_pdt_img_nc img").each(function() {
if($(this).attr("src") == "") {
$(".add_pdt_img_nc").remove();
}
});
but it remove div if first img src is null and not check if other img src has value
1 Answer