$dropDowns.forEach((el) => {
el.addEventListener("click", () => {
const menu = el.querySelector('.dropdown_menu')
if (menu.classList.contains('active')) {
menu.classList.remove("active")
} else {
menu.classList.add("active")
$dropMenus.forEach((element) => {
if (element === menu) {
return
} else {
element.classList.remove("active")
}
});
}
});
});
$dropDowns.forEach((el) => {
el.addEventListener("click", (e) => {
$dropDowns.forEach( element => element.classList.remove("active") );
e.target.classList.toggle("active");
});
});