init
This commit is contained in:
15
html/tasks/chapter_2/clock/script.js
Executable file
15
html/tasks/chapter_2/clock/script.js
Executable file
@@ -0,0 +1,15 @@
|
||||
window.onload = updateTime;
|
||||
|
||||
function updateTime() {
|
||||
var time = new Date();
|
||||
var timeBox = document.getElementById("pointOfTime");
|
||||
var hours = time.getHours();
|
||||
var minutes = time.getMinutes();
|
||||
var seconds = time.getSeconds();
|
||||
|
||||
timeBox.innerHTML = hours+":"+minutes+":"+seconds;
|
||||
|
||||
/* setTimeout(updateTime, 1000); */
|
||||
}
|
||||
|
||||
setInterval(updateTime, 1000);
|
Reference in New Issue
Block a user