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

154
Vistas
JavaScript - Initial value to Target value within a set time

I have an integer value that I want to take from the initial value of 0 to 100 over the span of 10 seconds; However, I don't want it to start from 0 and go instantly to 100 within that time-span, I want it to climb up to that value overtime, so from 0 to 1 to 2, etc. How could this effect be achieved?

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

0

You can use setInterval and update the value:

    let value = 0;
    
    let interval = setInterval(function () {
      if(value >= 10) {
        clearInterval(interval);
        return 
      }        

      value++;
      
      document.getElementById("value").innerHTML = value;
    }, 1000);
<div id="value">0</div>

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