Target a un boton y sus elementos internos

PHOTO EMBED

Sun Oct 31 2021 19:12:46 GMT+0000 (Coordinated Universal Time)

Saved by @rstringa #click

document.addEventListener("click", e => {
if(e.target.matches(".clase")||e.target.matches(`${".clase"} *`)) {
  
  ...
}
})

/* Otro */

  document.addEventListener("click", (e) => { 

        if(e.target.classList.contains("desplegable") || e.target.parentElement.classList.contains("desplegable")) {

            document.querySelector(".filtros-desplegables").classList.toggle("is-active");
        }
        
      })
  
content_copyCOPY