Created
April 18, 2013 20:38
-
-
Save tapickell/5416039 to your computer and use it in GitHub Desktop.
JS timer
This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<p>A script on this page starts this clock:</p> | |
<p id="demo"></p> | |
<script> | |
var myVar=setInterval(function(){myTimer()},1000); | |
function myTimer() | |
{ | |
var d=new Date(); | |
var t=d.toLocaleTimeString(); | |
document.getElementById("demo").innerHTML=t; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment