badwolfff
asked on
How do I use jQuery to hide an empty div?
I tried it on jsfiddle: https://jsfiddle.net/lupoc atttivo/tm Lw9e56/
but it doesn't seem to work :(
any ideas?
thanks
but it doesn't seem to work :(
any ideas?
thanks
ASKER
Thanks. But I need the jquery to work on my html. It is auto-generated so I can't intervene on its formatting.
any ideas?
any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
it's because it has (space) between the <div> and</div> tag, once removed all the space it worked :)
existing DIV
<div class="newprice" style="padding-bottom: 10px; width:200px; height:200px; background-color:#ff0080">
</div>
Empty DIV
<div class="newprice" style="padding-bottom: 10px; width:200px; height:200px; background-color:#ff0080"> </div>
existing DIV
<div class="newprice" style="padding-bottom: 10px; width:200px; height:200px; background-color:#ff0080">
</div>
Empty DIV
<div class="newprice" style="padding-bottom: 10px; width:200px; height:200px; background-color:#ff0080">
https://jsfiddle.net/tmLw9e56/1/