I want the numbers inside the list to animate so it displays different number for that duration when button is on click state. But it seems jquery animation is not working inside of it for loop.
$("button").on("click",function(){
for(var i=0; i < 2; i++ ){
$({value: $(".number").eq(i).text()}).animate({value: data1[i]},{
duration: 500,
easing: 'swing',
step: function(){
$(".number").eq(i).text(parseInt(this.value));
}
});
}
});