»
EnglishFrenchVietnamese

Print - Simple Textbox Clock script - JavaScriptBank.com

Full version: jsB@nk » Time » Clock » Simple Textbox Clock script
URL: https://www.javascriptbank.com/simple-textbox-clock-script.html

Simple Textbox Clock script © JavaScriptBank.comSimple textbox-style clock.

Full version: jsB@nk » Time » Clock » Simple Textbox Clock script
URL: https://www.javascriptbank.com/simple-textbox-clock-script.html



HTML
<script language="javascript">now=new Date();var now,hrs,min,sec,clkv;var spc=(navigator.appName=="Netscape")? "  ":"       ";document.write('<form name="f"><input type="text" name="t" size="16"></form>');function runclk(){now=new Date();hrs=now.getHours();min=now.getMinutes();sec=now.getSeconds();clkv=((hrs >12) ? hrs-12:hrs)+"";clkv=((clkv.length==1)? "0"+clkv :clkv);clkv+=((min < 10) ? ":0" : ":") + min;clkv+=((sec < 10) ? ":0" : ":") + sec;clkv+=(hrs >= 12) ? " P.M." : " A.M.";clkv=spc+clkv;document.f.t.value=clkv;}window.onload=function(){  setInterval('runclk()',300);;}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->