clock with javascript

+1 Ananthakrishnan VK · July 2, 2015
how to create an automatically updating clock with javascript ?

Post a Reply

Replies

Oldest  Newest  Rating
0 Aju Antony · July 3, 2015
watch bucky's javascript tutorial, its in there
0 Mahmoud Atwa · July 4, 2015






    




    
    
        //Declare the variables :"the function will be repeated so the declaration will be repeated so it might slow the execution speed."
        var x , h , m , s , full;
        function clock() {
            x = new Date();
            h = x.getHours();
            m = x.getMinutes();
            s = x.getSeconds();
            full = h + ':' + m + ':' + s;
            document.getElementById("inner").innerHTML = full;
        }
        setInterval(clock , 1000);
        
    
    



  • 1

Javascript

107,176 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators