here's my js:
$(document).ready(function() {
    $('.LoginContainer').hide();
    $('.list li a').click(function(){
    $('.LoginContainer').toggle();
    });
});
This only makes the div with class="loginContainer" appear for a split se开发者_StackOverflow社区cond and then dissapear. I want for the div to appear when I click the link, and then dissapear when I click the link again.
Try this:
  $('.list li a').click(function(e){
     $('.LoginContainer').toggle();
     e.preventDefault();
  });
You can Try this
$(document).ready(function() {
     $('.className').click(function(e){
          $('.LoginContainer').toggle();
          e.preventDefault();
     });
}
I agree with e.preventDefault();
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论