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

176
Visualizações
mdn divide event handling in three phases then why taget phase fire two time

MDN doc explained event handling on all modern browsers handled in three phases which are:

           1.capturing phase -->(top most to target parent) 
           2.target phase -->(element on where event happened)
           3.the bubbling phase -->(target parent to top most element)

and after all this doc read what i understand is, these three phase are independent from each other but this demonstration confuse me. because here target event fire two times i did not understand why this is not fire only once or it fire with respect to capture and bubbling phase not independent.

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

There are two event listeners attached to each div in the code, one for bubbling and the other for capturing. So you'll get two results at the target level, one from each event.

Normally when writing code you'd choose to add an event listener for either bubbling or capturing, not both of them, so you'd only see only one event fire at the target level.

about 4 years ago · Santiago Gelvez Relatório
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