setInterval()
returns an interval ID, which you can pass to clearInterval()
:
var refreshIntervalId = setInterval(fname, 10000);
/* later */
clearInterval(refreshIntervalId);
See the docs for setInterval()
and clearInterval()
.
More Related Contents:
- event.preventDefault() vs. return false
- What is DOM Event delegation?
- What is event bubbling and capturing?
- setTimeout or setInterval?
- Why does the setInterval callback execute only once?
- add event listener on elements created dynamically
- DOM event precedence
- How can I programmatically invoke an onclick() event from a anchor tag while keeping the ‘this’ reference in the onclick function?
- HTML input file selection event not firing upon selecting the same file
- How can I pause setInterval() functions?
- Will setInterval drift?
- Pass mouse events through absolutely-positioned element
- jQuery equivalent of JavaScript’s addEventListener method
- In React, what’s the difference between onChange and onInput?
- Trigger onmouseover event programmatically in JavaScript
- How to stop “setInterval” [duplicate]
- Prevent parent container click event from firing when hyperlink clicked [duplicate]
- Is setInterval CPU intensive?
- onMouseMove get mouse position [duplicate]
- Do I need to remove event listeners before removing elements?
- How to fire a change event on a HTMLSelectElement if the new value is the same as the old?
- With form validation: why onsubmit=”return functionname()” instead of onsubmit=”functionname()”?
- cloning javascript event object
- JavaScript KeyCode Values are “undefined” in Internet Explorer 8
- Call a Javascript function every 5 seconds continuously [duplicate]
- How to listen for child window closing?
- JavaScript Event prototype in IE8
- How browser executes Javascript and renders asynchronously
- Detecting support for a given JavaScript event?
- In web browsers, what’s the difference between onblur and onfocusout?