This repository was archived by the owner on May 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq4_mes_extenso.html
More file actions
119 lines (114 loc) · 3.77 KB
/
q4_mes_extenso.html
File metadata and controls
119 lines (114 loc) · 3.77 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html lang="pt">
<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>Verificar qual é o mês</title>
<style>
body {
background: #e0e262;
font: normal 20pt times;
}
header {
color: rgb(15, 15, 15);
text-align: center;
}
div.entrada {
background: #59c4ee;
border-radius: 13px;
padding: 15px;
width: auto;
margin: auto;
text-align: center;
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.384);
}
div.saída {
background: #ececea;
border-radius: 13px;
padding: 15px;
width: auto;
margin: auto;
text-align: center;
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.384);
}
IMG.abaixo {
display: block;
margin-left: auto;
margin-right: auto
}
footer {
color: black;
text-align: center;
font-style: oblique;
}
</style>
</head>
<body>
<header>
<h1>Indicar o mês.</h1>
</header>
<section>
<div class="entrada">
<p >
Digite o número inteiro: <input style="font: normal 20pt times; width: 50px; height: 30px;" type="number" id="txtnum">
</p>
<p style="text-align: center;">
<input style="font: normal 20pt times;" type="button" value="Identificar!" onclick="identificar()">
</p>
</div>
<div class="saída" id="saida">
</div>
</section>
<footer>
<p>© BrunoCastro </p>
</footer>
<script>
function identificar() {
const entrada = window.document.querySelector('input#txtnum')
const mes = Number(entrada.value)
const saida = window.document.querySelector('div#saida')
switch (mes) {
case 1:
saida.innerHTML = `<p> O mês indicado foi <strong>Janeiro</strong>.<p>`
break
case 2:
saida.innerHTML = `<p> O mês indicado foi <strong>Fevereiro</strong>.<p>`
break
case 3:
saida.innerHTML = `<p> O mês indicado foi <strong>Março</strong>.<p>`
break
case 4:
saida.innerHTML = `<p> O mês indicado foi <strong>Abril</strong>.<p>`
break
case 5:
saida.innerHTML = `<p> O mês indicado foi <strong>Maio</strong>.<p>`
break
case 6:
saida.innerHTML = `<p> O mês indicado foi <strong>Junho</strong>.<p>`
break
case 7:
saida.innerHTML = `<p> O mês indicado foi <strong>Julho</strong>.<p>`
break
case 8:
saida.innerHTML = `<p> O mês indicado foi <strong>Agosto</strong>.<p>`
break
case 9:
saida.innerHTML = `<p> O mês indicado foi <strong>Setembro</strong>.<p>`
break
case 10:
saida.innerHTML = `<p> O mês indicado foi <strong>Outubro</strong>.<p>`
break
case 11:
saida.innerHTML = `<p> O mês indicado foi <strong>Novembro</strong>.<p>`
break
case 12:
saida.innerHTML = `<p> O mês indicado foi <strong>Dezembro</strong>.<p>`
break
default:
saida.innerHTML = `<p><strong>Mês inválido!</strong><p>`
break
}
}
</script>
</html>