»
EnglishFrenchVietnamese

Print - LCD Digital Clock - JavaScriptBank.com

Full version: jsB@nk » Time » Clock » LCD Digital Clock
URL: https://www.javascriptbank.com/lcd-digital-clock.html

LCD Digital Clock © JavaScriptBank.comThis digital clock JavaScript code attempts to parody that cool 'glowing in the dark night' look of a LCD clock watch by its interface. LCD displays the time in standard 12-hour format, with a 'AM' and 'PM' indicator. Note that in non IE4+/NS6+ browsers, a regular form HTML clock is displayed instead. You can make this clock free download easily.

Full version: jsB@nk » Time » Clock » LCD Digital Clock
URL: https://www.javascriptbank.com/lcd-digital-clock.html



CSS
<style><!--.styling{background-color:black;color:lime;font: bold 15px MS Sans Serif;padding: 3px;}--></style>


JavaScript
<script><!--/****************************************** LCD Clock script- by Javascriptkit.com*****************************************/var alternate=0var standardbrowser=!document.all&&!document.getElementByIdif (standardbrowser)document.write('<form name="tick"><input type="text" name="tock" size="6"></form>')function show(){if (!standardbrowser)var clockobj=document.getElementById? document.getElementById("digitalclock") : document.all.digitalclockvar Digital=new Date()var hours=Digital.getHours()var minutes=Digital.getMinutes()var dn="AM"if (hours==12) dn="PM" if (hours>12){dn="PM"hours=hours-12}if (hours==0) hours=12if (hours.toString().length==1)hours="0"+hoursif (minutes<=9)minutes="0"+minutesif (standardbrowser){if (alternate==0)document.tick.tock.value=hours+" : "+minutes+" "+dnelsedocument.tick.tock.value=hours+"   "+minutes+" "+dn}else{if (alternate==0)clockobj.innerHTML=hours+"<font color='lime'>&nbsp;:&nbsp;</font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"elseclockobj.innerHTML=hours+"<font color='black'>&nbsp;:&nbsp;</font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"}alternate=(alternate==0)? 1 : 0setTimeout("show()",1000)}window.onload=show//--></script>


HTML
<span id="digitalclock" class="styling"></span>