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

153
Vistas
odometer.js get html content

How to get the HTML content of the odometer counter in ordermeter.js.

<div class='odometer'>1234</div>

<script>
    $( '.odometer' ).html(); // not working correctly
</script>

the odometer counter is increased dynamically every 3 seconds. When I try to use the .html() function of jQuery, at times it's giving some weird numbers.

Has odometer.js created a way to access text from the counter?

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

0

If you import the OdometerJS library in your page it will transform the divs using class="odometer and so the .html() method wont return the same result as the one you initially wrote in your page However if you want the value of the integer inside the div you can use .val() or .text() so in your case

<div class='odometer' id="number">1234</div>

<script>
    let x = $( '#number' ).val(); //get the current value of div with id:number
    console.log(x); //this will show the value of the #number div at the time of execution

</script>
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