I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event?
setInterval(fname, 10000);
I want the us
Use setTimeOut to stop the interval after some time.
var interVal = setInterval(function(){console.log("Running") }, 1000); setTimeout(function (argument) { clearInterval(interVal); },10000);