-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
118 lines (105 loc) · 2.73 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
<style>
body{
background-color: rgb(184, 174, 174);
}
#head{
font-size: larger;
font-weight: bold;
display: flex;
justify-content: center;
}
input[type=number] {
background-color: rgb(221, 202, 202);
width: 200px;
margin: 14px;
padding: 14px;
margin-left: 0px;
}
button[type=submit]{
background-color: rgb(221, 202, 202);
width: 150px;
margin: 14px;
padding: 14px;
margin-left: 0px;
border-radius: 30px;
}
.top{
background-color: #ae46c0;
width: 500px;
border-radius: 40px;
height: 600px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
h1{
text-align: center;
font-size: 45px;
text-shadow: 4px 4px 4px chartreuse ;
}
h2{
font-style: italic;
}
</style>
</head>
<body>
<h1> Temperature Foecast </h1>
<div id="head">
<div class="top">
<form onsubmit="temperature(); return false" >
<label for ="tem" >Enter Temperature</label><br>
<input type="number" id="tem" placeholder="Enter Temperature Here">
<br>
<button type="submit" >Check</button>
<h2 id="temp"></h2>
</form>
</div>
</div>
<script>
function temperature(){
let num = +document.querySelector("#tem").value;
let t=num;
if ( t >= 50)
{
document.querySelector("#temp").innerHTML = `The Hottest Day`;
}
else if(t >= 40 )
{
document.querySelector("#temp").innerHTML = ` It's too Hot Day`;
}
else if(t >= 30 )
{
document.querySelector("#temp").innerHTML = ` It's a Hot Day`;
}
else if(t >= 25 )
{
document.querySelector("#temp").innerHTML = ` It's a Normal Day`;
}
else if(t >= 15 )
{
document.querySelector("#temp").innerHTML = ` It's a Pleasant Day`;
}
else if(t >= 10 )
{
document.querySelector("#temp").innerHTML = ` It's a Cold Day`;
}
else if(t >= 1 )
{
document.querySelector("#temp").innerHTML = ` It's too Cold Day`;
}
else
{
document.querySelector("#temp").innerHTML = ` It's a Freezing Day`;
}
}
</script>
</body>
</html>