About This Script
Place this code inside the <head> section of your page.
Demo
The script is running on this page. Look at the title shown on the tab to see it in action.Code
<script>
// Clock provided by http://www.top-site-list.com
(function(){
function updateTitleTime() {
var now = new Date();
var h = now.getHours();
var m = now.getMinutes();
var s = now.getSeconds();
m = padTime(m);
s = padTime(s);
document.title = h + ':' + m + ':' + s;
}
function padTime(i) {
if (i < 10) {
i = '0' + i;
}
return i;
}
setInterval(updateTitleTime, 1000);
})();
</script>
More scripts