The timepiece operates correctly until reaching zero, where it should start the break timer. However, there is an issue as it goes into negative numbers once it hits zero. Below is the function containing this troublesome code. Just a heads up, I have set the interval to 100 to speed up testing the clock.
//The problematic function
function start(){
$("#start").addClass("disabled");
$("#myreset").addClass("disabled");
var secs = Number("59");
var min = document.getElementById("sessiontime").innerHTML;
min = min-=1;
if(min > -1){
startcounter = setInterval(function(){
secs--;
if(secs > 9){
document.getElementById("mytimer").innerHTML = min +":"+ secs;
} else if(secs >= 0 && secs < 10){
secs = "0"+secs;
document.getElementById("mytimer").innerHTML = min +":"+ secs;
} else if(secs < 0){
min--;
secs = 59;
} else if(secs === 0 && min === 0){
clearInterval(startcounter);
var x = document.getElementById("arrownumid").innerHTML;
mybreak(x);
}
},100);
}
}