My problem is that the more I "click" on the Start time button, the faster it counts. How can I change it to normal 2 minute countdown timer? Like this: http://www.donothingfor2minutes.com/
My code:
var minute = 1;
var second = 59;
function time(){
setInterval(starttime, 1000);
}
function starttime(){
document.getElementById("timer").innerHTML = minute +" : " + second ;
second--;
if(second == 00) {
minute--;
second = 59;
if (minute == 0) {
minute = 2;
}
}
}
1000