-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (63 loc) · 1.95 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JS Calculator</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
crossorigin="anonymous"
/>
<script defer src="scripts.js"></script>
<style>
.error,
.results {
display: none;
}
.error {
background-color: red;
color: white;
padding: 2em;
text-align: center;
}
.results {
background-color: green;
color: white;
padding: 2em;
text-align: center;
}
</style>
</head>
<body>
<div class="container my-5">
<h1 class="mb-5">JS calculator</h1>
<form>
<div class="mb-3">
<label for="number1" class="form-label">Number 1</label>
<input type="text" class="form-control" id="number1" />
</div>
<div class="mb-3">
<select class="form-select" id="operation">
<option selected disabled value="">Select an operation...</option>
<option value="+">Addition</option>
<option value="*">Multiplication</option>
<option value="-">Substraction</option>
<option value="/">Division</option>
</select>
</div>
<div class="mb-3">
<label for="number2" class="form-label">Number 2</label>
<input type="text" class="form-control" id="number2" />
</div>
<button type="submit" class="btn btn-primary">Calculate</button>
<a href="#" id="reset" class="btn btn-secondary">Reset</a>
</form>
<div class="error mt-5"></div>
<div class="results mt-5">
<p>Résultat : <span id="results"></span></p>
</div>
</div>
</body>
</html>