I have tabs on my website, but sometimes the tab doesn’t contain any info like this:
<div class="idTabs">
<div class="tabIt">
<a class="selected" href="#productDetails" name="Tab1">Description</a>
</div>
<div class="tabIt">
<a href="#specs" name="Tab2" class="">Specifications</a>
</div>
</div>
<div class="productInformation">
<div class="information">
<div id="productDetails" style="display: block; ">
<div class="productInfo">
</div>
</div>
<div id="specs" style="display: none; ">
</div>
</div>
</div>
How can I make it shouldn’t display the tabs if it doesn’t contain any information?
Thanks
You’ll probably need RegEx for that. Something like this:
Same with jQuery:
It will also hide the DIV if it contains only whitespaces.