Answers for "click anywhere and div hide javascript"

1

click anywhere and div hide javascript

document.addEventListener('mouseup', function(e) {
  let container = document.getElementById('container');
  if (!container.contains(e.target)) {
    container.style.display = 'none';
  }
});
Posted by: Guest on December-03-2020

Code answers related to "click anywhere and div hide javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language