77
rated 0 times
[
82]
[
5]
/ answers: 1 / hits: 30343
/ 12 Years ago, thu, august 2, 2012, 12:00:00
My Jquery:
function myTimer() {
var sec = 15
var timer = setInterval(function() {
$('#timer').text(sec--);
if (sec == -1) {
clearInterval(timer);
alert('done');
}
} , 1000);
}
$(#knap).click(function() {
myTimer();
});
$(#reset).click(function() {
// set timer to 15 sec again..
});
I want the timer to be reset when clicked on #reset.
More From » jquery