Jason - 9 months ago 59
Javascript Question

# Resetting a setTimeout

I have the following:

window.setTimeout(function() {
window.location.href = 'file.php';
}, 115000);


How can I, via a .click function, reset the counter midway through the countdown?

You can store a reference to that timeout, and then call clearTimeout on that reference.
// in the example above, assign the result