Skip to content

Instantly share code, notes, and snippets.

@PyramisDev
Created August 2, 2013 04:21
Show Gist options
  • Save PyramisDev/6137471 to your computer and use it in GitHub Desktop.
Save PyramisDev/6137471 to your computer and use it in GitHub Desktop.
Simple javascript counter. The .getElementById("id") refers to the css id of the target element.
function init() {
var n = 0;
e = document.getElementById("output");
setInterval(function() { e.innerHTML = ++n; }, 1000);
}
window.onload = init;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment