Hide text based on if it's an image or not
Hey!
I have some dynamic generated divs, sometimes there's an image into one of the subdivs and sometimes not. What I need to do is to hide/remove the MyText class (remove the text) if there is an image in it's sibling class called MyImage... So if there's an image I want to hide the text belonging (parent) to this div the image lives into. Hope I explained this in a readable way
here's the dynamic generated HTML:
<div class="Content">
<div class="MyImage"><img src="someImage.jpg"/></div>
<div class="MyText">xxx</div>
</div>
<div class="Content">
<div class="MyImage"></div>
<div class="MyText">zzz</div>
</div>
<div class="Content">
<div class="MyImage"><img src="someImage.jpg"/></div>
<div class="MyText">yyy</div>
</div>
Anyone got an idea how to to this?
Thanks!