-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex5.html
More file actions
45 lines (39 loc) · 959 Bytes
/
Copy pathex5.html
File metadata and controls
45 lines (39 loc) · 959 Bytes
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
42
43
44
45
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>Exercicio 5</title>
<meta charset="utf-8">
<script type="text/javascript">
/*Crie uma página HTML vinculada a um arquivo JavaScript, que informa o dia da semana corrente e um cumprimento em função do período do dia, exemplo se for antes do meio-dia a página deve dizer “Bom dia ! Hoje é segunda-feira !“, após ao meio-dia “Boa tarde ! Hoje é segunda-feira !“
*/
var data = new Date();
var dia = data.getDay();
var hora = data.getHours();
switch(dia){
case 0:
document.write('Domingo');
break;
case 1:
document.write('segunda-feira');
break;
case 2:
document.write('Terça');
break;
case 3:
document.write('Quarta');
break;
case 4:
document.write('Quinta');
break;
case 5:
document.write('Sexta');
break;
case 6:
document.write('Sabado');
break;
}
</script>
</head>
<body>
</body>
</html>