<script> var i = 0; hd1 = document.getElementById('hd1'); window.t1 = setInterval(u1,1000); function u1(){ hd1.innerHTML = i; i++; } </script>