title: update let value onclick
body: <p>I'm trying to update a boolean value onclick without any luck.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const myDropdownMenu = document.getElementById("dropdownMenu");
  const openNav = document.getElementById("openNav");
  const closeNav = document.getElementById("closeNav");
  
  let mobileMenu = false;
  
  function toggleMenu() {
    mobileMenu = !mobileMenu;
  }
  
  if (mobileMenu) {
    myDropdownMenu.style.display = "flex";
    closeNav.style.display = "flex";
    openNav.style.display = "none";
  } else {
    myDropdownMenu.style.display = "none";
    openNav.style.display = "flex";
    closeNav.style.display = "none";
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;a href="index.html"&gt;
      &lt;h1&gt;CAVVD&lt;/h1&gt;
    &lt;/a&gt;
    &lt;div id="mobileNav" class="mobileNavigation"&gt;
      &lt;button id="openNav" onclick="toggleMenu();"&gt;
              Open
            &lt;/button&gt;
      &lt;button id="closeNav" onclick="toggleMenu();"&gt;
              Close
            &lt;/button&gt;
      &lt;div id="dropdownMenu"&gt;
        &lt;a href="index.html#sobreNosotros"&gt;Sobre Nosotros&lt;/a&gt;
        &lt;a href="index.html#reuniones"&gt;Reuniones&lt;/a&gt;
        &lt;a href="ForodeConsultas.html"&gt;Foro de Consultas&lt;/a&gt;
        &lt;a href="index.html#HaceteVoluntario"&gt;Hacete Voluntario&lt;/a&gt;
        &lt;a href="Fotos.html"&gt;Fotos&lt;/a&gt;
        &lt;a href="index.html#contacto"&gt;Contacto&lt;/a&gt;
        &lt;a class="Dona" a href="index.html#Dona!"&gt; Doná!&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Everything is working except the <code>let mobileMenu</code>, that is not updating with the <code>toggleMenu()</code> function. But if I return a simple <code>console.log</code> or <code>alert</code>, it works.</p>
  <p>Can anybody help me? thanks</p>