-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
79 lines (70 loc) · 2.18 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
<!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>GRADE</title>
</head>
<style>
.convertor {
background-color: blueviolet;
min-height: 800px;
border: 10px solid black;
}
h1 {
text-align: center;
}
form {
text-align: center;
}
p {
text-align: center;
color: yellow;
}
</style>
<body>
<div class="convertor">
<h1>What's your Grade</h1>
<form onsubmit="Gradechecker(); return false">
<label for="percentage">Write your percentage here!</label>
<input type="number" id="percentage">
<input type="submit" value="Convert into Grade">
</form>
<p id="result"></p>
</div>
<script>
function Gradechecker() {
let percentage= +document.querySelector("#percentage").value;
if (percentage > 100) {
document.querySelector("#result")
.innerHTML = "Dear Academic freak! Its impossible to attain more than 100 percentage. Kindly enter the right one";
}
else if (percentage > 80) {
document.querySelector("#result")
.innerHTML = "Congrats! You got A1 Grade";
}
else if (percentage > 70) {
document.querySelector("#result")
.innerHTML = "Congrats! You got A Grade";
}
else if (percentage > 60) {
document.querySelector("#result")
.innerHTML = "Congrats! You got B Grade! Have potential to acheive A grade!";
}
else if (percentage > 50) {
document.querySelector("#result")
.innerHTML = "You got C Grade! Need to improve your grades to prove yourself!";
}
else if (percentage > 1 && percentage < 49) {
document.querySelector("#result")
.innerHTML = "Need to give more time to studies to pass the exam!";
}
else {
document.querySelector("#result")
.innerHTML = "Its not possible! We are sure you have achieved more than the entered number!";
}
}
</script>
</body>
</html>