-
Notifications
You must be signed in to change notification settings - Fork 0
/
tijdstip.html
29 lines (26 loc) · 1.02 KB
/
tijdstip.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Opdracht: Tijdstip</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<script type="text/javascript">
let vandaag = new Date();
let currentTime = vandaag.getHours();
if (currentTime <= 7) {
document.write(`Goeienacht, het is nu ${currentTime} uur!`);
} else if (currentTime >= 7 && currentTime <= 11) {
document.write(`Goeiemorgen, het is nu ${currentTime} uur!`);
} else if (currentTime >= 11 && currentTime <= 18) {
document.write(`Goeiemiddag, het is nu ${currentTime} uur!`);
} else {
document.write(`Goeienacht, het is nu ${currentTime} uur!`);
}
</script>
</body>
</html>