Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <input type="text" id="clock" /> <script> var int = self.setInterval(function(){clock()}, 1000); function clock() { var d = new Date(); var t = d.toLocaleTimeString(); document.getElementById("clock").value = t; } </script> <button onclick="int=window.clearInterval(int)">Stop</button> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_setinterval by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:37:29 GMT --> </html>
Result:
Try it Yourself - © w3schools.com