KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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.
Tags (comma-separated)
Save Edits
Cancel