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

141
Vistas
What is causing a one keypress delay?

When I type something it gets delayed by one keypress. for example if I type h, it would be blank, if i type helloworld it would be helloworl. If I have sad displayed, I would have to press backspace twice to get to sa instead of once. Why is there this delay? How do I fix it?

<input type="text" id = "new"></input>
<p id = "result"></p>
<script src = "script.js" type = "module"></script>
var search = document.getElementById("new");
var resultbox = document.getElementById("result");
search.addEventListener("keydown", function(){
  resultbox.innerHTML = search.value;
})
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

keydown or keypress is execed before the new character is added to the value of the element.

you can use input or keyup event.

search.addEventListener("input", function(){
  resultbox.innerHTML = search.value;
})
about 4 years ago · Juan Pablo Isaza Denunciar
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