Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda