-
Notifications
You must be signed in to change notification settings - Fork 11
/
Calculator.html
61 lines (49 loc) · 2.14 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
<!DOCTYPE html>
<html>
<head>
<title>A Simple Calculator</title>
<link rel="stylesheet" type="text/css" href="css/custom.css">
</head>
<body>
<div id="calculator" align="center">
<div>
<input id="screen" value="0"><br>
</div>
<div>
<button onclick="processNumberButton(this.innerHTML)">1</button>
<button onclick="processNumberButton(this.innerHTML)">2</button>
<button onclick="processNumberButton(this.innerHTML)">3</button>
<button onclick="processOperatorButton(this.innerHTML)" class="operator">+</button>
</div>
<div>
<button onclick="processNumberButton(this.innerHTML)">4</button>
<button onclick="processNumberButton(this.innerHTML)">5</button>
<button onclick="processNumberButton(this.innerHTML)">6</button>
<button onclick="processOperatorButton(this.innerHTML)" class="operator">-</button>
</div>
<div>
<button onclick="processNumberButton(this.innerHTML)">7</button>
<button onclick="processNumberButton(this.innerHTML)">8</button>
<button onclick="processNumberButton(this.innerHTML)">9</button>
<button onclick="processOperatorButton(this.innerHTML)" class="operator">/</button>
</div>
<div>
<button onclick="processNumberButton(this.innerHTML)">0</button>
<button onclick="processDecimalButton(this.innerHTML)">.</button>
<button onclick="processPercentageButton(this.innerHTML)">%</button>
<button onclick="processOperatorButton(this.innerHTML)" class="operator">x</button>
</div>
<div>
<button onclick="processNumberButton(this.innerHTML)">00</button>
<button onclick="processParenthesesButton(this.innerHTML)">(</button>
<button onclick="processParenthesesButton(this.innerHTML)">)</button>
<button onclick="processOperatorButton(this.innerHTML)" class="operator">^</button>
</div>
<div>
<button onclick="processResetButton()" class="reset">C</button>
<button onclick="processEqualsButton()" class="eval">=</button>
</div>
</div>
<script type="text/javascript" src="js/simplecalculator.js"></script>
</body>
</html>