title: Making my drop down menu collapse when an anchor link is clicked on small devices using javascript
body: <p>so i am trying to make my responsive drop down menu that shows up when smaller screens are active collapse when an anchor link is selected from the dropdown menu.</p>
  
  <p>i've looked all over the internet for solutions, but i'm lost.  Ive seen a few solutions, but i don't know how to fit them into my specific code...can someone maybe help me figure this out...</p>
  
  <p>the specific page i am referring to is <a href="http://www.valentinosgourmet.com/menu.html" rel="nofollow noreferrer">http://www.valentinosgourmet.com/menu.html</a></p>
  
  <p>here is the script code currently.. there are 2 because i have the main navigation navbar and then a second one with all the menu stuff</p>
  
  <blockquote>
    <p>
        // Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon</p>
  </blockquote>
  
  <pre><code>    function myFunctionGetMainNav() {
          var x = document.getElementById("myTopnav");
          if (x.className === "topnav") {
              x.className += " responsive";
          } else {
              x.className = "topnav";
          }
      }
  
  &lt;/script&gt;
  
  &lt;script&gt;
  // Toggle between adding and removing the "responsive" class to menunav when the user clicks on the icon
  
      function myFunctionGetMenuNav() {
          var x = document.getElementById("menuNavbar");
          if (x.className === "menunav") {
              x.className += " responsiveMenu";
          } else {
              x.className = "menunav";
          }
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>any help in the right direction would be much appreciated!</p>
  
  <p>thank you!</p>