Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script language="javascript">
- var LiveClock = new Date();
- window.onload = update;
- function update(){
- var hours = LiveClock.getHours();
- var minutes = LiveClock.getMinutes();
- var seconds = LiveClock.getSeconds();
- if(hours < 10){
- hours = "0" + hours;
- }
- if(minutes < 10){
- minutes = "0" + minutes;
- }
- if(seconds < 10){
- seconds = "0" + seconds;
- }
- document.getElementById("LiveClock").innerHTML = hours + ":" + minutes + ":" + seconds;
- setTimeout("update()", 1000);
- }
- </script>
- <div id="LiveClock"></div>
Add Comment
Please, Sign In to add comment