-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
60 lines (53 loc) · 2.65 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1">
<title>Tip Calculator</title>
<link rel="stylesheet" href="TipCalculatorStyle.css">
<!-- Import jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<!-- Import autoNumeric script -->
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.6.0/dist/autoNumeric.min.js" integrity="sha256-3Wb3op3+AoWpYw7gTNYr1TgugE+UImzilAi5nI2Oqvw=" crossorigin="anonymous"></script>
</head>
<body>
<div id="container">
<h1>Tip Calculator</h1>
<div id="calculator">
<form>
<label>
<p>How much was your bill?<br>
£ <input type="text" inputmode="decimal" id="billAmount" placeholder="bill amount" autofocus required autocomplete="off"></p>
</label>
<p>How was your service?<br>
<select id="serviceQuality">
<option disabled selected value="0">-- Choose an option --</option>
<option value="0.3">30℅ - Outstanding</option>
<option value="0.2">20℅ - Good</option>
<option value="0.15">15℅ - It was okay</option>
<option value="0.10">10℅ - Bad</option>
<option value="0.05">5℅ - Terrible</option>
</select></p>
<label>
<p>How many people are sharing the bill?<br>
<input type="text" inputmode="decimal" id="totalPeople" placeholder="number of" autocomplete="off"> people</p>
</label>
<div id="buttons">
<button type="button" id="calculate">Calculate</button>
<button type="reset" id="reset">Reset</button>
</div>
</form>
</div><!-- #calculator -->
<div id="totals">
<div id="totalTip">
<p>Tip amount: <span id="tip">0.00</span>
<small id="tipEach">each</small></p>
</div>
<div id="totalBill">
<p>Final bill amount: <span id="bill">0.00</span>
<small id="billEach">each</small></p>
</div>
</div>
</div><!-- #container -->
<script type="text/javascript" src="TipCalculator.js"></script>
</body>
</html>