-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (52 loc) · 4.22 KB
/
Copy pathindex.html
File metadata and controls
54 lines (52 loc) · 4.22 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CALCULATOR</title>
<link rel="stylesheet" href="style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
<body>
<h1 class="first">CALCULATOR</h1>
<div class="container">
<div class="row">
<div class="col-md-12">
<form action="#" name="calculator" class="main">
<input type="text" class="display form-control" name="display" id="display"><br>
<input type="button" class="btn" value="C" id="clear" style="background: #31337a; color: white;">
<input type="button" class="btn ms-3" value="->" style="background: #31337a; color: white;" onclick="backSpace()">
<input type="button" class="btn ms-3" value="%" style="background: #31337a; color: white;" onclick="document.calculator.display.value+='%'">
<input type="button" class="btn ms-3" value="/" style="background: red; color: white;" onclick="document.calculator.display.value+='/'"><br><br>
<input type="button" class="btn" value="7" style="background: #0d6efd; color: white;" onclick="seven()">
<input type="button" class="btn ms-3" style="background: #0d6efd; color: white;" value="8" onclick="eight()">
<input type="button" class="btn ms-3" value="9" style="background: #0d6efd; color: white;" onclick="nine()">
<input type="button" class="btn ms-3" value="*" style="background: red; color: white;" onclick="document.calculator.display.value+='*'"><br><br>
<input type="button" class="btn" value="6" style="background: #0d6efd; color: white;" onclick="six()">
<input type="button" class="btn ms-3" value="5" style="background: #0d6efd; color: white;" onclick="five()">
<input type="button" class="btn ms-3" value="4" style="background: #0d6efd; color: white;" onclick="four()">
<input type="button" class="btn ms-3" value="-" style="background: red; color: white;" onclick="document.calculator.display.value+='-'"><br><br>
<input type="button" class="btn" value="3" style="background: #0d6efd; color: white;" onclick="three()">
<input type="button" class="btn ms-3" value="2" style="background: #0d6efd; color: white;" onclick="two()">
<input type="button" class="btn ms-3" value="1" style="background: #0d6efd; color: white;" onclick="one()">
<input type="button" class="btn ms-3" value="+" style="background: red; color: white;" onclick="document.calculator.display.value+='%'"><br><br>
<input type="button" class="btn" value="0" style="background: #0d6efd; color: white;" onclick="zero()">
<input type="button" class="btn ms-3" value="00" style="background: #0d6efd; color: white;" onclick="document.calculator.display.value+='00'">
<input type="button" class="btn ms-3" value="." style="background: #0d6efd; color: white;" onclick="point()">
<input type="button" class="btn ms-3" style="background: red; color: white;" value="=" onclick="document.calculator.display.value = eval(calculator.display.value)">
</form>
</div>
</div>
</div>
<script src="custom.js"></script>
<script src="https://code.jquery.com/jquery-3.7.1.slim.min.js"
integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"
integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"
integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+"
crossorigin="anonymous"></script>
</body>
</html>