Return to Snippet

Revision: 36819
at November 27, 2010 01:42 by magicrebirth


Initial Code
<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>

Initial URL
http://www.w3schools.com/jsref/met_win_setinterval.asp

Initial Description

                                

Initial Title
Running scripts ciclically

Initial Tags
javascript

Initial Language
JavaScript