So I can't seem to find a way to hide a parent element based on a certain circumstance. I have two sections of code that work individually but can't figure out how to combine them. So here is the element I am working with:
<div id="grid_content">
<img src="img/test_0000.jpg" class="staticimg">
</div>
I need the 'div' to hide when the image source is empty. I can make the 'img' itself hide when empty (src="") using the CSS:
img[src=""] {display: none;}
And also I can make the div hide if empty using the CSS:
#grid_content:empty {display: none;}
So, the question is how can I make '#grid_content' hide when the image 'src' is empty?