I want to hide a div container when there is no <h5> in it. Normally the div container would be hide. When the server pulls feeds from other website, a <h5> will be add inside the div container. Then the div should show up on the page.
Here is a simplify version of the HTML structure without out <h5>
<div id="alert-feed">
<div class="webpart-title">Title</div>
<div class="webpart-body">
<div class="contianer">
<ul class="feedlist">
<li class="campusfeed">
<ul class="articlelist"></ul>
</li>
</ul>
</div>
</div>
</div>
Here is the HTML with <h5>
<div id="alert-feed">
<div class="webpart-title">Title</div>
<div class="webpart-body">
<div class="contianer">
<ul class="feedlist">
<li class="campusfeed">
<ul class="articlelist">
<li>
<a><h5 class="articletitle"></h5></a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
So I want to hide the #alert-feed by adding a class no-alert when there is no <h5> inside it. I know this could be simply done by using hasClass and addClass, but the structure is really confusing me and I can't do anything about it. So could someone help me to figure out how to do this?
h5tag?