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

247
Vistas
How to pause js function until user presses the button?

I have an html button on my site and I want my js function to stop until user presses it. onclick="nextFunction()" doesn't help me because I need to continue in the same function. What should I do?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can call a function after a while using the setTimeout.

const someFunction = () => {

    // do some stuff before

    setTimeout('function that you want to execute after the pause', 3000 ); // the time is in miliseconds

    // some stuff after 

}

In your case if i'm not wrong there is an listener named onmousedown, that execute something while the stuff is pressed. https://www.w3schools.com/jsref/event_onmousedown.asp

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