When attaching a click event listener to the body using javascript, how do you write a conditional(s) that only trigger if e.target is not the element that contains the class active or any of that elements children? There are children elements within active that need to be clickable. Similar to when you click anywhere on a modal it stays open, but anywhere else on the DOM it is removed?
document.body.addEventListener("click", e => {
if (!e.target ...) {
// trigger functions
}
}