Hide div / element if user signed in
422                
                
                     MVP                
            Ok this is a html request but need some help please.
I have a div, and wish to hide that div if user is signed in.
@Todd did some code earlier, but not sure how to accomplish what I want. I suppose I would or could display:none but... anyhoo..
< script language="javascript">
                        jQuery(document).ready(function($) {
                        if (gdn.definition('SignedIn', '0') != '0') {
                            < div class="sp-container">
                                
                            < /div>
                        }
                        });
                        < /script>
I wish to hide content of sp-container if user not logged in. Tried using Todds code but I am pretty crap with js etc.
There was an error rendering this rich post.
1          
            
        
            
Answers
Have ur div in page and in script in { } try something like
$('.sp-container').css('display' , 'none');
Or $('.sp-container').html(' '); to clear all content of div
There was an error rendering this rich post.
$('.sp-container').hide();or
$('.sp-container').css({'visibility':'hidden'});If you want to keep the space.
grep is your friend.
Brilliant thanks guys, I opted for .hide method. Thanks a million
There was an error rendering this rich post.