Return to Snippet

Revision: 15196
at June 26, 2009 20:10 by adamdecaf


Initial Code
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

	<p id="foo" style="font-size: 15em; font-weight: bold; margin-top: 0px; text-align: center;">
		1
	</p>

<script>
// Go...
var e = document.getElementById("foo");

// Set the interval
setInterval(function () {

	// Increment
	e.innerHTML -= -1;
	
return;
}, 100, e);
	// Make sure to pass the element along with the function.
	// A value of 0 for the timeout will make the browser go as fast as it can. (NOT RECOMMENDED)
</script>
</body>
</html>

Initial URL


Initial Description


Initial Title
JavaScript Counter

Initial Tags


Initial Language
JavaScript