Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!