title: Search / Filter Dropdown: Change value variable when click
body: <p>I just implemented a Search / Filter Dropdown, following this guide: <a href="https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_js_dropdown_filter" rel="nofollow noreferrer">https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_js_dropdown_filter</a>.</p>
  
  <pre><code>&lt;h2&gt;Search/Filter Dropdown&lt;/h2&gt;
          &lt;p&gt;Click on the button to open the dropdown menu, and use the input field to search for a specific dropdown link.&lt;/p&gt;
  
          &lt;div class="dropdown"&gt;
            &lt;button onclick="myFunction()" class="dropbtn"&gt;Dropdown&lt;/button&gt;
            &lt;div id="myDropdown" class="dropdown-content"&gt;
              &lt;input type="text" placeholder="Search.." id="myInput" onkeyup="filterFunction()"&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>This Search / Filter Dropdown takes the array of the allNameMuseums () method as values, ie ["ACQUARIUM", "Museo2", "Museo3"].        </p>
  
  <pre><code> document.addEventListener("DOMContentLoaded", function(event) {
        allNameMuseums().forEach(function(item) {
          document.getElementById("myDropdown").innerHTML += '&lt;a href="' + item + '"&gt;' + item + '&lt;/a&gt;';
        })
      });
  
  
      function myFunction() {
        document.getElementById("myDropdown").classList.toggle("show");
      }
  
      function filterFunction() {
        var input, filter, ul, li, a, i;
        input = document.getElementById("myInput");
        filter = input.value.toUpperCase();
        div = document.getElementById("myDropdown");
        a = div.getElementsByTagName("a");
        for (i = 0; i &lt; a.length; i++) {
          if (a[i].innerHTML.toUpperCase().indexOf(filter) &gt; -1) {
            a[i].style.display = "";
          } else {
            a[i].style.display = "none";
          }
        }
      }
  
      function allNameMuseums() {
        return ["ACQUARIO", "Museo2", "Museo3"];
      }
  </code></pre>
  
  <p>I have two asynchronous methods, specificoMuseo(name) and allMuseums (), and a variable <code>var data = proof;</code> that takes the result of the allMuseums() method.</p>
  
  <pre><code>specificoMuseo(name).then(proof2 =&gt; {
              allMuseums().then(proof =&gt; {
  
  var data = proof;
  
   });
      });
  </code></pre>
  
  <p>I want that when I click on ACQUARIO of Search / Filter Dropdown the variable 'data' takes as input the result of specificoMuseo ("ACQUARIO").</p>