-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.html
65 lines (52 loc) · 2.78 KB
/
calculator.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
<!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>Document</title>
</head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<body >
<form action="">
<div class="row mt-5 p-5">
<div class="col-4"></div>
<div class="col-4">
<table >
<tr>
<td colspan="3"><input type="text" class="form-control"id="result"></td>
<td><button type="button" onclick="allClear()" class="btn btn-primary btn-lg">AC</button> </td>
</tr>
<tr >
<td ><button id="seven" onclick="displayNum('7')" type="button" class="btn btn-light btn-lg">7</button></td>
<td ><button id="eight" onclick="displayNum('8') "type="button" class="btn btn-light btn-lg">8</button></td>
<td><button id="nine" onclick="displayNum('9') "type="button" class="btn btn-light btn-lg">9</button></td>
<td ><button type="button"onclick="displayNum('') " class="btn btn-light btn-lg"></button></td>
</tr>
<tr >
<td><button id="four" onclick="displayNum('4') "type="button" class="btn btn-light btn-lg">4</button></td>
<td><button id="five"onclick="displayNum('5') "type="button" class="btn btn-light btn-lg">5</button></td>
<td><button id="six"onclick="displayNum('6') "type="button" class="btn btn-light btn-lg">6</button></td>
<td><button id="minus"onclick="displayNum('-') " type="button" class="btn btn-light btn-lg">-</button></td>
</tr>
<tr >
<td><button id="one" onclick="displayNum('1') "type="button" class="btn btn-light btn-lg">1</button></td>
<td><button id="two"onclick="displayNum('2') "type="button" class="btn btn-light btn-lg">2</button></td>
<td><button id="three" onclick="displayNum('3') "type="button" class="btn btn-light btn-lg">3</button></td>
<td><button id="plus"onclick="displayNum('+') "type="button" class="btn btn-light btn-lg">+</button></td>
</tr>
<tr>
<td><button id="div"type="button" onclick="displayNum('/') "class="btn btn-light btn-lg">/</button></td>
<td><button id="zero" type="button"onclick="displayNum('0') " class="btn btn-light btn-lg">0</button></td>
<td><button id="equal" onclick="evalExp()" type="button" class="btn btn-primary btn-lg">=</button></td>
<td><button id="del" onclick="lastDigit()" type="button" class="btn btn-primary btn-lg">c</button></td>
</tr>
</table>
</div>
<div class="col-4"></div>
</div>
</form>
<script src="./calc.js"></script>
</body>
</html>