Answers for "clear inteval"

26

Javascript stop setInterval

var myInterval = setInterval(function(){console.log("mmk")}, 2000);

clearInterval(myInterval); //stop that interval
Posted by: Guest on July-23-2019
0

clear inteval

/*  add interval to a variable */
var flashing = setInterval(function(){
$('.flash').toggleClass('red');
},300);

/* add a timerout function to clear the intervalfunction  */
setTimeout(function(){
clearInterval(flashing);
},1500);
Posted by: Guest on September-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language