I need to make a jQuery incremental/decremental loop.
So I'm posting the vanilla JavaScript here, Can anyone change this into jQuery code for me please.
var incomeTicker = 60;
window.setInterval(function(){
if (incomeTicker > 0){
incomeTicker--;
document.getElementById("incomeTicker").innerHTML = "Next Profit In : " + incomeTicker + " seconds";
// other code implemented as long as incomTicker > 0
}
if (incomeTicker <= 1){
//code that is implemented when incomeTicker <=1
incomeTicker = 60;
//code that is implemented when incomeTicker <=1
}
}, 1000);
<span class = "incomeTicker" id = "incomeTicker" > Next Profit In : 100 seconds</span>
Can anyone help translate this into jQuery? It must decrement and then reset after loop is complete as shown in the snippet