-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.html
36 lines (35 loc) · 2.03 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css"> <!-- Link to the CSS file -->
<title>Calculator</title>
</head>
<body>
<div class="calculator">
<input type="text" id="result" readonly>
<div class="buttons">
<input type="button" value='7' onclick="appendToResult('7')">
<input type="button" value='8' onclick="appendToResult('8')">
<input type="button" value='9' onclick="appendToResult('9')">
<input type="button" value='+' class="operator" onclick="appendToResult('+')">
<input type="button" value='4' onclick="appendToResult('4')">
<input type="button" value='5' onclick="appendToResult('5')">
<input type="button" value='6' onclick="appendToResult('6')">
<input type="button" value='-' class="operator" onclick="appendToResult('-')">
<input type="button" value='1' onclick="appendToResult('1')">
<input type="button" value='2' onclick="appendToResult('2')">
<input type="button" value='3' onclick="appendToResult('3')">
<input type="button" value='*' class="operator" onclick="appendToResult('*')">
<input type="button" value='/' class="operator" onclick="appendToResult('/')">
<input type="button" value='0' onclick="appendToResult('0')">
<input type="button" value='00' onclick="appendToResult('00')">
<input type="button" value='=' class="operator" onclick="calculateResult()">
<input type="button" value='C' onclick="clearResult()">
</div>
</div>
<script src="calculator.js"></script> <!-- Link to the JavaScript file -->
</body>
</html>