How can we hide div if it is blank?

Enrico

New Member
Example: http://partnerswealth.advisorproducts.com/home
http://mah.advisorproducts.com/homeRequirement:I want to hide Left and Right div or Box when it is empty.Below is the HTML code i am using:\[code\]<div class="Box secondaryBackground"><div class="innerBox containerBackground"><h2> </h2><div class="innerBoxContent"><div class="eNews"> </div></div></div></div>\[/code\]Below is the js i am using - and trying to add DispNone class only in that Box class div whose innerBoxContent children div is empty.So i just want to add class in Box class div if innerBoxContent class div children like eNews is empty.\[code\]$(document).ready(function () { str = $('.innerBoxContent > div').text(); if ($.trim(str) === "") { $('.innerBox').parent().addClass('DispNone'); } else { $('.innerBox').parent().removeClass('DispNone'); }});\[/code\]Can we modify this code?ThanksSushil
 
Back
Top