Skip to content

Instantly share code, notes, and snippets.

@cmaujean
Created September 27, 2011 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmaujean/1244692 to your computer and use it in GitHub Desktop.
Save cmaujean/1244692 to your computer and use it in GitHub Desktop.
countdown displayed in a button
function dotimes(amount) {
$('button#continue_shopping_button').html("Continue Shopping (" + amount + ")");
if (amount == 0 ) {
$('button#continue_shopping_button').trigger('click');
return;
} else {
amount = amount - 1;
setTimeout("dotimes(" + amount + ")", 1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment