title: Calling a function on ONCLICK event
body: <p>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?</p>
  
  <p>I have added just Onclick event on the container div and calling my close function</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>I dont wanna call the function if i click on its inner HTML elements, just for the container div.</p>