Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Create Real Time Changing Clock

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 269
    Comment on it

    With the help of javascript we can create changing clock time function. In the example given below I am using setTimeout function (changed other value) when clock refresh it will show the exact time once in every seconds.

    <html>
    <head>
    <title>(Type a title for your page here)</title>
    <script type="text/javascript"> 
    function display_c(){
    var refresh=1000; // Refresh rate in milli seconds
    mytime=setTimeout('display_ct()',refresh)
    }
    
    function display_ct() {
    var strcount
    var x = new Date()
    document.getElementById('ct').innerHTML = x;
    tt=display_c();
    }
    </script>
    </head>
    
    <body onload=display_ct();>
    <span id='ct' ></span>
    
    </body>
    </html>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: