I am using this code to animate the digits. Is there any way to animate each digit into separate span. I need to give padding with background for each digit and need space between each digit.
Number is starting from 0 which is expected functionality.
$('.count').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 4000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="test">
<span class="count">200</span>
</div>
