I'm calling a function by ONCLICK event for the div conatiner but it also being called when I click on its inner elements so how can I call the function only for the div container not for its inner elements?
I have added just Onclick event on the container div and calling my close function
function closeMenu() {
var target = document.getElementById("login-container");
target.style.opacity = "0";
target.style.zIndex = "-10";
}
var closeBtn = document.getElementById("close-overlay");
closeBtn.addEventListener("click", closeMenu);
I dont wanna call the function if i click on its inner HTML elements, just for the container div.