Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!