<div id="clock"></div> <script> var d = 3; function dd() { document.getElementById('clock').innerHTML = d++; } setInterval(dd, 1000); </script> </body>