-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (44 loc) · 2.01 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
<!DOCTYPE html>
<html>
<head>
<title>Simple Interest Calculator</title>
<!-- Link JS script to add functionality to the site & link CSS file to add styling to the site -->
<script src="script.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="maindiv">
<h1>Simple Interest Calculator</h1>
<!-- Input box that will take in the amount value (investment amount) -->
Amount <input type="number" id="principal"> <br/>
<!-- Input box that will take in the rate value and be displayed a slider for the user to select a rate (interest rate) -->
Rate <input type="range" id="rate" min="1" max="20" value="10.25" step="0.25" onchange="updateRate()"> <br/>
<!-- Default value of the rate will be 10.25 -->
<span id="rate_val"> 10.25 </span>% <br/>
<!-- Input box that will allow the user to select the # of year they want to invest (drop-down menu) -->
No. of Years <input type="number" id="years" list="all_years">
<datalist id="all_years">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</datalist>
<!-- Display output/results to the user -->
Interest : <span id="result"></span><br>
<!-- Display the output/results only when the user clicks on the "Compute Interest" Button-->
<button onclick="compute()">Compute Interest</button>
<span id="result"> </span>
</div>
<br>
<!-- Copyright message -->
<footer>
© This Calculator belongs to Munqiz Minhas
</footer>
</body>
</html>