I need to make a dropdown menu when clicked. I know how to do it for one button, but I know how to do it for severalbuttons.
const submenuBtn = document.querySelectorAll(".submenu-btn");
const submenuContent = document.querySelectorAll(".submenu-content");
const toggleMenuBox = () => {
submenuContent.forEach(item => item.classList.toggle("active"));
};
submenuBtn.forEach(event => event.addEventListener("click", () => {
toggleMenuBox();
}))
3