How to stop setInterval call in JavaScript
The clearInterval method has to be used to stop the setInterval call.
The setInterval method returns ID which can be used as the parameter for the clearInterval method.
var intervalID = setInterval( myFunction, 5000 ); clearInterval( intervalID );