Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
what is the connection of event propagation in event delegation?

const ul = document.querySelector("ul");
ul.addEventListener(
  "click",
  (event) => {
    console.log(event.target);
  },
  true
);
<ul>
  <li>
    <h2> ITEM 1 </h2>
  </li>
  <li>
    <h2> ITEM 2 </h2>
  </li>
</ul>

how is event propagation involved in this event listener? (is it involved at all?) since changing the third argument of the event listener does nothing in this code snippet, I can't understand the connection of event propagation here

in the above code; event.target always refers to the h2 element if we click on it, and never refers to the li, even though we have enabled capturing phase in this example.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda