Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to remove document.getElementById("myDropdown").classList.toggle("show");

function myFunction() {
  document.getElementById("myDropdown2").classList.remove("show");
  document.getElementById("myDropdown").classList.toggle("show");
}

function myFunction2() {
  document.getElementById("myDropdown").classList.remove("show");
  document.getElementById("myDropdown2").classList.toggle("show");
}

// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
  if (!event.target.matches('.dropbtn')) {
    var dropdowns = document.getElementsByClassName("dropdown-content");
    var i;
    for (i = 0; i < dropdowns.length; i++) {
      var openDropdown = dropdowns[i];
      if (openDropdown.classList.contains('show')) {
        openDropdown.classList.remove('show');

      }
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: find smallest interval in array javascript 
Javascript :: for each add character javascript 
Javascript :: find only vowels in string Javascript 
Javascript :: check event target jquery outside 
Javascript :: nuxt facebook graph api 
Javascript :: why does it say require is not defines 
Javascript :: exemplo simples de socket com node 
Javascript :: synthetic linkText 
Javascript :: javascript expressions JSX 
Javascript :: excluding a attribute from json strigify 
Javascript :: express react docker container example 
Javascript :: onclick confirm jquery anchor tag 
Javascript :: ex:javascript array 
Javascript :: mongodb mongoose field value not among a set of values 
Javascript :: scrollable div and unscrollable middle component 
Javascript :: nodejs postgresql scalar query 
Javascript :: how to copy one array to another in javascript 
Javascript :: 18002738255 
Javascript :: how to access values from a form event callback 
Javascript :: what is reveal.js plugin 
Javascript :: LogRocket 
Javascript :: guardar en una variable la peticion ajax 
Javascript :: reqeuest body in hapijs 
Javascript :: how to calculate each row with on change table <td<input jquery 
Javascript :: JS exercise bank account constructor functions and prototypes solution 
Javascript :: how to create duplicate key array in javascript 
Javascript :: reference self in ajax callback 
Javascript :: what does results.push({}) nodejs mean 
Javascript :: Why is #_=_ appended to the redirect URI? passport facebook 
Javascript :: change abclground onload jquery 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =