Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda