The code below it counts minutes and seconds if the toggle button is clicked. Is it possible to make it cancel everything if its clicked/toggled, meaning that i can be able to clicked another toggle button.
function toggle(ths) {
var clicked = $(ths).val();
$("#lblType").html(clicked);
$("#setCount").html(" minutes : " + minutes + " seconds : " + count);
count = count + 1;
if (count % 60 == 0) {
minutes += 1;
count = 0;
}
timer = setTimeout("toggle()", 1000);
}
<div ><label id="lblType"></label>
<label id="setCount"></label>
</div></p>
<div id="planned"></div>