setinterval javascript stop in for loop code example
Example: setinterval break
var refreshIntervalId = setInterval(fname, 10000);
/* later */
clearInterval(refreshIntervalId);
var refreshIntervalId = setInterval(fname, 10000);
/* later */
clearInterval(refreshIntervalId);