-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp27.html
More file actions
48 lines (41 loc) · 1.22 KB
/
p27.html
File metadata and controls
48 lines (41 loc) · 1.22 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>This is JS programming</title>
<script type="text/javascript">
function CalculateGrade() {
marks = document.getElementById("txtMarks").value;
if (marks>=0 && marks<40)
{
alert("Your mark is " + marks + " and you are failed");
}
else if (marks>=40 && marks<50)
{
alert("Your mark is " + marks + " and your grade is D");
}
else if (marks>=50 && marks<60)
{
alert("Your mark is " + marks + " and your grade is C");
}
else if (marks>=60 && marks<70) {
alert("Your mark is " + marks + " and your grade is B");
}
else if (marks>=70 && marks<80) {
alert("Your mark is " + marks + " and your grade is A");
}
else if (marks>=80 && marks<100) {
alert("Your mark is " + marks + " and your grade is A+");
}
else
{
alert("Sorry!!!!! You have enter greater than 100 marks")
}
}
</script>
</head>
<body>
Input your marks: <input type="text" id="txtMarks"> <br>
<button onclick="CalculateGrade();">OK</button>
</body>
</html>