Live Digital Clock - Javascript andrey вторник, 4 ноября 2014 г. No Comment

Here is the code for Live digital clock.

Just we are going write a function to get the current time and display it in span. We are calling that function for each 1000 milli seconds. so, live clock is working.

var int=self.setInterval("clock()",1000);
function clock(){
var now=new Date();
var time=now.toLocaleTimeString();
document.getElementById("clock").textContent=time;
};
 Here is the live Demo

Thanks Christian White

Here is the code for Live digital clock.

Just we are going write a function to get the current time and display it in span. We are calling that function for each 1000 milli seconds. so, live clock is working.

var int=self.setInterval("clock()",1000);
function clock(){
var now=new Date();
var time=now.toLocaleTimeString();
document.getElementById("clock").textContent=time;
};
 Here is the live Demo

Thanks Christian White

by Jillur Rahman

Jillur Rahman is a Web designers. He enjoys to make blogger templates. He always try to make modern and 3D looking Templates. You can by his templates from Themeforest.

Follow him @ Twitter | Facebook | Google Plus

No Comment