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

171
Visualizações
Blur/Click difference in Chrome and Firefox

I, perhaps naively, thought there weren't any significant browser differences anymore, but compare the behaviour of the below in Firefox and Chrome

https://jsfiddle.net/2b5mnvwt/1/

Specifically, type some text in the textbox then press the button. The button click fires in Firefox but not in Chrome

Is the difference because of something I'm doing wrong or is it a well-known issue? Which is right?

document.getElementById("theTextBox").addEventListener("blur", OnBlur, false);
document.getElementById("theButton").addEventListener("click", ButtonClick, false);

function ButtonClick(e) {
  console.log('button')
  alert('button')
}

function OnBlur(e) {
  console.log('blur')
  alert('blur')

  //e.relatedTarget.focus();
  //e.relatedTarget.click();
}
<input id="theTextBox" type="text" />
<button id="theButton">Click Me</button>

NB The change event has the same behaviour

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