0
Guys I’m trying to make a timer, until it’s working the problem is that it only decreases the time if I keep clicking, and I need it to dimiua alone after I click once.
var mins = "30";
var secs = "00";
function timeCount(){
if (secs == "00"){
secs = "60";
mins -= 1;
}
i = 0;
do {
secs -= 01;
i++;
}
while(i < secs.length);
if (secs < "10"){
secs = "0" + secs +"";
}
if (mins == "0"){
console.log("acabou");
}
time = ''+ mins + ':' + secs + '';
$("#time").html(time);
console.log(time);
}
<div id="timer" onclick="setTimeout(timeCount, 3000)">
<span id="time">30:00</span>
</div>
If anyone can give me a hand there I thank. : D
See, man, that’s what/
– Ingi