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

223
Vistas
How to delay a javascript function

I use this code and it works so that when i reload the page the button is autoclicked but i want to make a delay so that it will be clicked after 60 seconds from page reloading

window.onload = function () {
  var button = document.getElementById('clickButton');
  button.form.submit();
};
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

window.onload = function() {
  setTimeout(() => {
    var button = document.getElementById('clickButton');
    button.form.submit();
  }, 60000); 
}

Use setTimeout() https://developer.mozilla.org/en-US/docs/Web/API/setTimeout

about 4 years ago · Juan Pablo Isaza Denunciar

0

To delay a page to execute some function use setTimeout takes in most cases two arguments the first is the function to be excuted after such a amount of time given by the second argument in ms

setTimeout(
function(){
 var button = document.getElementById('clickButton'); 
button.form.submit(); 
}
, 60*1000);//60 * 1000 = 60000ms = 60s 
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