-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
53 lines (46 loc) · 1.76 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
<!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>JavaScript Toy Problems</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- This code creates a simple HTML form that includes an input field for the student marks and
a button to calculate the grade. When the user clicks the button, the calculateGrade function is called,
which reads the value of the input field, calculates the corresponding grade, and displays it in a paragraph
element below the form. -->
<div>
<h1>Student Grade Calculator</h1>
<form>
<label for="marks">Enter student marks (between 0 and 100):</label>
<input type="number" id="marks" name="marks" min="0" max="100">
<button type="button" onclick="calculateGrade()">Calculate</button>
</form>
<p id="grade"></p>
</div>
<div>
<h1>Speeding Ticket Calculator</h1>
<form>
<label for="speed">Enter the car's speed (in km/h):</label>
<input type="number" id="speed" name="speed" required>
<button type="button" onclick="calculate()">Calculate</button>
</form>
<p id="result"></p>
</div>
<div>
<h1>Net Salary Calculator</h1>
<form id="salary-form">
<label for="basic-salary">Basic Salary:</label>
<input type="number" id="basic-salary" name="basic-salary"><br>
<label for="benefits">Benefits:</label>
<input type="number" id="benefits" name="benefits"><br>
<button type="button" id="calculate-button">Calculate</button>
</form>
<div id="result"></div>
</div>
<script src="./main.js"></script>
</body>
</html>