Last active
April 4, 2024 22:05
-
-
Save lambdamusic/4734408 to your computer and use it in GitHub Desktop.
JavaScript: Running scripts ciclically #js
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
<html> | |
<body> | |
<input type="text" id="clock" /> | |
<script language=javascript> | |
var int=self.setInterval("clock()",1000); | |
function clock() | |
{ | |
var d=new Date(); | |
var t=d.toLocaleTimeString(); | |
document.getElementById("clock").value=t; | |
} | |
</script> | |
</form> | |
<button onclick="int=window.clearInterval(int)">Stop</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment