1var myInterval = setInterval(function(){console.log("mmk")}, 2000);
2
3clearInterval(myInterval); //stop that interval
1/* add interval to a variable */
2var flashing = setInterval(function(){
3$('.flash').toggleClass('red');
4},300);
5
6/* add a timerout function to clear the intervalfunction */
7setTimeout(function(){
8clearInterval(flashing);
9},1500);