call function time interval jquery code example
Example 1: jquery call function every second
setInterval(function(){
}, 1000);
Example 2: javascript setinterval
setInterval(function(){
console.log("Oooo Yeaaa!");
}, 2000);
Example 3: javascript interval fixed number of times
var x = 0;
var intervalID = setInterval(function () {
if (++x === 5) {
window.clearInterval(intervalID);
}
}, 1000);
Example 4: javascript setinterval
setInterval(function(){
console.log("print this once every 3 second");
}, 3000);