Skip to main content

Posts

Showing posts with the label Digital Clock Using Javascript

Digital Clock Using Javascript

Digital Clock Using Javascript This tutorial focuses on the setTimeout function for javascript, using which we can set a interval to a span tag and make it like a working digital clock. You can choose any tag in the HTML and force to refresh it on a set interval on its own, without making the page load or heavy using ajax calls to the server, below is the complete HTML code for a Digital Clock using javascript. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>   <head>   <meta http-equiv="content-type" content="text/html; charset=windows-1250">   <title>Digital Clock | Javascript</title>   <script language="JavaScript" type="text/javascript">     function showtime() {       now=new Date();       hour=now.getHours();       min=now.getMinutes();       sec=now.getSeconds();          if (min...