let myDrowp = document.getElementById("myDropdown");
let drop_btn = document.querySelector(".dropbtn");
let dropdown=document.querySelector('.dropdown-content')

drop_btn.addEventListener("click", myFunction);

function myFunction() {
  myDrowp.classList.toggle("show");
}

window.onclick = function (event) {
  if (!event.target.matches(".dropbtn")) {
    if(dropdown.classList.contains('show')){
      myDrowp.classList.remove('show')
    }
  }
};
