I need to \"animate\" a variable with jquery.
Example: The variable value is 1. The value should be 10 after 5 seconds. It should be increase \"smoothl
This should work for you:
var a = 1; var b = setInterval(function() { console.log(a); a++; if (a == 10) { clearInterval(b); } }, 500);