Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- function startTime() {
- var today = new Date();
- var h = today.getHours();
- var m = today.getMinutes();
- var s = today.getSeconds();
- var mil = today.getMilliseconds();
- m = checkTime(m);
- s = checkTime(s);
- mil = Math.floor(checkTime(mil)/100);
- document.getElementById('txt').innerHTML =
- h + ":" + m + ":" + s + ":" + mil;
- var t = setTimeout(startTime,100);
- if(s == 11) {var audio = new Audio('Recording.flac'); audio.play();}
- }
- function checkTime(i) {
- if (i < 10) {i = "0" + i}; // add zero in front of numbers < 10
- return i;
- }
- </script>
- </head>
- <body onload="startTime()">
- <div id="txt"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement