var timeout,
counter = 0;
var updateCounter = function() {
$('.counter').text(counter++);
timeout = setTimeout(updateCounter, 1000);
}
updateCounter();
var updateCounter = function() {
var timeout,
counter = 0;
$('.counter').text(counter++);
timeout = setTimeout(updateCounter, 1000);
}
updateCounter();