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

157
Views
JQuery se enfoca y selecciona en la siguiente entrada que no funciona

Uso focus() y también select() para enfocar y seleccionar el siguiente elemento, pero esto funciona bien en el escritorio, y también en la vista del dispositivo Chrome (móvil) pero no funciona en un teléfono inteligente como Android (lo probé en el navegador Chrome), alguna idea de cómo ¿para resolver este problema?

 $('.verf-code input').on('keypress',function(e) { var key = e.which; if (key >= 48 && key <= 57) { $(this).addClass('hasCode').next('input').select().focus(); return true; } else if (key == 8 || key == 46) { $(this).removeClass('hasCode'); } else { return false; } });
 .hasCode { border: 1px solid orange; }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="verf-code"> <input type="text" /> <input type="text" /> <input type="text" /> <input type="text" /> </div>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba esto:

 $(".verf-code input").on("keyup", function (e) { var key = e.which; if ($(this).val() !== '') { $(this).addClass('hasCode').next('input').select().focus(); }else if(key == 8 || key == 46){ $(this).removeClass('hasCode'); } });
 .hasCode { border: 1px solid orange; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input[type=number] { -moz-appearance: textfield; }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="verf-code"> <input type="number" /> <input type="number" /> <input type="number" /> <input type="number" /> </div>

about 4 years ago · Juan Pablo Isaza 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!