KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
clearTimeout() inside setTimeout() method not working in JavaScript var c = 0; var t; function timedCount() { document.getElementById('txt').value = c; c = c + 1; if (c == 5) { clearTimeout(t); } t = setTimeout(function () { timedCount() }, 1000); } jsFiddle
Tags (comma-separated)
Save Edits
Cancel