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
How can I fire Tab keypress with JavaScript only. No jQuery

I have been looking all around the internet and I can not a solution to my problem.

I have an input field called Destination. When a user starts typing the city name, a suggestion dropdown appears that gives the user suggestions if he/she is searching for that specific city.

I added an addEventListener("input", broji); to the input field so that a action happens when a user types 3 characters in the input field.

Here is the code:

function broji(){
    if(from.value.length == 3){
        console.log("three characters")
        //fire TAB click, so that it autofills the 
        // input field.
    }
}

from.addEventListener("input", broji);

So right now, every time when a user types three characters in the input field, I get "three characters" result in the console.

The only thing that I need now is to find out how can I fire a keypress for the TAB key when a user types three characters in the input field?

Thank you once again!

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!