title: How do I get a hamburger menu to hide when clicking a menu item that links to a section on the page?
body: <pre><code>$('.menu-icon').click(function(event) {
         if ( $( '.menu-icon' ).hasClass( 'open' ) ) {
              $('.menu-icon').toggleClass('open');
              $('header').toggleClass('remove-bg');
              $('nav').fadeOut();
              $('#dot').show();
          } else {
              $('.menu-icon').toggleClass('open');
              $('header').toggleClass('remove-bg');
              $('nav').css("display", "flex").hide().fadeIn();
              $('#dot').hide();
          }
      });
  </code></pre>
  
  <p>The menu stays open but I want it to close when I click a menu item like About which links to #about</p>