Friday, 6 September 2013

How to hide HTML element containing only spaces using jQuery?

How to hide HTML element containing only spaces using jQuery?

I have the following HTML :
<div id="rightCon">
</div>
And then I have the following script at the top :
$('#rightCon:empty').hide();
Why is the div not hiding? I can see that there is some spaces(that I
can´t get ridoff) but does that really matter? How do I remove/hide this
div when its empty with only spaces?

No comments:

Post a Comment