-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDigClock.html
More file actions
41 lines (38 loc) · 1.22 KB
/
DigClock.html
File metadata and controls
41 lines (38 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Clock</title>
<link rel="stylesheet" href="DigClock.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
</head>
<body>
<div class="clock">
<div class="hour box">
<h3 class="hour-time">0 0</h3>
</div>
<p>:</p>
<div class="minute box">
<h3 class="minute-time">0 0</h3>
</div>
<p>:</p>
<div class="second box">
<h3 class="second-time">0 0</h3>
</div>
</div>
<script>
function time(){
let date = new Date();
let hour = date.getHours();
let minute = date.getMinutes();
let second = date.getSeconds();
document.querySelector(".hour-time").innerHTML = hour;
document.querySelector(".minute-time").innerHTML = minute;
document.querySelector(".second-time").innerHTML = second;
}
setInterval(time,1000);
</script>
</body>
</html>