JSFiddle - React, Tailwind, and code Playground
by adamschwartz
HTML
<div class="odometer">0</div>
CSS
</style><!-- This closes the open style tag above. Just a jsFiddle thing. Please ignore. -->
<!-- Odometr includes -->
<link rel="stylesheet" href="http://github.hubspot.com/odometer/themes/odometer-theme-default.css" />
<script src="http://github.hubspot.com/odometer/odometer.js"></script>
<!-- Extra styles for this example -->
<style>
.odometer {
font-size: 100px;
}
JavaScript
var value, plusOne;
value = parseInt(document.querySelector('.odometer').innerText);
plusOne = function() {
value += 1;
document.querySelector('.odometer').innerHTML = value;
};
setTimeout(plusOne, 0);
setInterval(plusOne, 5000);