I want to know if there is a way to restart/clear the setInterval(); function in Javascript? My problem is, when you go here:: http://jsfiddle.net/GqrRx/2/ (sorry it doesn't want to work here)... but if you go there and input a date, it works fine. But if you enter in another date, the seconds, minutes, and hours glitch up, and flicker. I think I need to find a way to restart the interval or stop it.
I tried putting this at the top of my function, but it didn't seem to do anything.
clearInterval(runSeconds);
clearInterval(runMinutes);
clearInterval(runHours);
I also tried this:
var secInt = setInterval(runSeconds, 1000);
var minInt = setInterval(runMinutes, 60000);
var hInt = setInterval(runHours, 3600000);
clearInterval(secInt);
clearInterval(minInt);
clearInterval(hInt);