How to implement this JavaScript in HTML -



How to implement this JavaScript in HTML -

this javascript showing time hour, min , seconds seconds ticking minutes alter it's not static have problem.how implement in html page ?

<script type="text/javascript"> function starttime() { var today = new date(); var h = today.gethours(); var m = today.getminutes(); var s = today.getseconds(); m = checktime(m); s = checktime(s); document.getelementbyid('txt').innerhtml = h + ":" + m + ":" + s; t = settimeout('starttime()', 500); } function checktime(i) { if (i < 10) { = "0" + i; } homecoming i; } </script>

edit body tag

<body onload="starttime()"> <span id="txt">10:26:07</span>

than add together bellow code want clock appear

javascript html time

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -