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

162
Views
My focus event listener is not getting triggered

When i try to fire a event listener in js for an input element it is not getting called. This is how I am trying to do it.

var el = document.getElementById(“inputEl”);

el. addEventListener('focus', (event) => {
  console.log(‘inside this block’);
});

What am I doing wrong here?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Change your js as below:

var el = document.getElementById("inputEl");

el.addEventListener('focus', (event) => {
  console.log('inside this block');
});

And also place your .js file at the bottom in your index.html

about 4 years ago · Santiago Trujillo Report
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!