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

225
Vistas
debugging JS on mobile browser - focus function not working

Right, so I'm having some issues with focusing on elements on mobile browsers. Desktop works fine. I've tried click and focus but neither are working so I'm thinking it's maybe something to do with the way I'm identifying it. I know it's a little convoluted and messy but if there's a way to emulate a tab key press this would also work.

Effectively I have 5 inputs and when a single key press is detected in one, I want to move the user to the next one. The way the html is structured though means they are not siblings. I had them as siblings before and choosing nextSibling was working.

Any help appreciated. TIA

 {
            x = document.activeElement.id
            setTimeout(function () {
                document.getElementById("input" + (parseInt(x.toString().charAt(x.toString().length - 1)) + 1).toString()).focus()
                document.getElementById("input" + (parseInt(x.toString().charAt(x.toString().length - 1)) + 1).toString()).click()
            }, 10);

     }
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