Skip to content Skip to sidebar Skip to footer

How To Set Setinterval Period As Variable And To Remove Waiting Time?

I have a table with checkbox in each row. When the checkboxes are checked, the function will loop through to update the status of each row. here is my working fiddle: http://jsfidd

Solution 1:

Example how to remove interval

<script>var myVar=setInterval(function(){myTimer()},1000);
functionmyTimer()
{
  // do things here
}
functionmyStopFunction()
{
// clear interval hereclearInterval(myVar);
}
</script>

Or

<script>var myVar=setInterval(myTimer,1000);
    functionmyTimer()
    {
      // do things here
    }
    functionmyStopFunction()
    {
    // clear interval hereclearInterval(myVar);
    }
    </script>

Post a Comment for "How To Set Setinterval Period As Variable And To Remove Waiting Time?"