diff --git a/index.html b/index.html index 191d3cc..eb03735 100644 --- a/index.html +++ b/index.html @@ -7,8 +7,23 @@ -
+ +
+ + + + +
+ + + + + - + + diff --git a/index.js b/index.js index 877a3aa..c5b83cf 100644 --- a/index.js +++ b/index.js @@ -1 +1,15 @@ -// Your code here +$(document).ready(function() { + + // var intervalID = window.setInterval(ticking, 1000); + var tick = window.setInterval(function(){ticking()}, 1000); + + var ticking = function() { + var clock = new Date(); + var hours = ((clock.getHours() < 10) ? '0' : '') + clock.getHours() + var minutes = ((clock.getMinutes() < 10) ? '0' : '') + clock.getMinutes() + var seconds = ((clock.getSeconds() < 10) ? '0' : '') + clock.getSeconds() + var timeNow = $('

' + hours + ':' + minutes+ ':' + seconds+ '

'); + $('#clock').html(timeNow); + } + +});