Snippets Collections
function flujoEventos(e) {
  console.log(
    `Hola te saluda ${this} el click lo originó ${e.target.className}`
  );
  //e.stopPropagation();
}

document.addEventListener("click", (e) => {
  if (e.target.matches(".eventos-flujo div")) {
    flujoEventos(e);
  }

  if (e.target.matches(".eventos-flujo a")) {
    alert("Hola soy tu amigo y docente digital... Jonathan MirCha");
    e.preventDefault();
    //e.stopPropagation();
  }
});
star

Sun Oct 31 2021 17:32:00 GMT+0000 (Coordinated Universal Time) https://jonmircha.com/dom

#addeventlistener

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension