Created
March 20, 2014 04:33
-
-
Save airekans/9657311 to your computer and use it in GitHub Desktop.
A sample JS timer in HTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
window.onload = function() { | |
var test_elem = document.getElementById('test'); | |
var number = 1; | |
test_elem.innerText = number; | |
setInterval(function() { | |
++number; | |
test_elem.innerText = number; | |
}, 1000); | |
} | |
</script> | |
</head> | |
<body> | |
<div id="test"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment