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 Whi...
Tuesday, 4 November 2014
Subscribe to:
Posts (Atom)