<html> <body> <input type="text" id="clock" size="35" /> <script type="text/javascript"> var int=window.setInterval("clock()",50); function clock(){ var t=new Date(); document.getElementById("clock").value=t; } </script> <br> <button οnclick="int=window.clearInterval(int)">Stop</button> </body> </html>