var refreshIntervalId = setInterval(fname, 10000); /* later */ clearInterval(refreshIntervalId); // See the docs for setInterval() and clearInterval()