Javascripts > 4x Browser Javascripts > Live HTML Clock Script
Script Title: Live HTML Clock Script
Description: This script displays the live time in HTML instead of the common textbox.
Example: Available
Copy the following code between the <BODY></BODY> tags of your html page.<span id=tick2> </span> <script> <!-- /* By George Chiang (WA's JavaScript tutorial) http://wsabstract.com */ function show2(){ if (!document.all) return var Digital=new Date() var hours=Digital.getHours() var minutes=Digital.getMinutes() var seconds=Digital.getSeconds() var dn="AM" if (hours>12){ dn="PM" hours=hours-12 } if (hours==0) hours=12 if (minutes<=9) minutes="0"+minutes if (seconds<=9) seconds="0"+seconds var ctime=hours+":"+minutes+":"+seconds+" "+dn tick2.innerHTML="<b style='font-size:22;color:blue;'>"+ctime+"</b>" setTimeout("show2()",1000) } window.onload=show2 //--> </script>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email