-
Notifications
You must be signed in to change notification settings - Fork 24
/
index.html
43 lines (43 loc) · 1.39 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
<!DOCTYPE html>
<html>
<head>
<title>Javascript Calculator</title>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div id="Calculator">
<button id="C" onclick="clearVariables()">c</button>
<div id="screen">
<p id="answer">0</p>
<p id="addCalcHistory">0</p>
</div>
<div id="buttons">
<div class="row">
<button id="7" onclick="digits('7')">7</button>
<button id="8" onclick="digits('8')">8</button>
<button id="9" onclick="digits('9')">9</button>
<button id="plus" onclick="setOperator('+')">+</button>
</div>
<div class="row">
<button id="4" onclick="digits('4')">4</button>
<button id="5" onclick="digits('5')">5</button>
<button id="6" onclick="digits('6')">6</button>
<button id="minus" onclick="setOperator('-')">-</button>
</div>
<div class="row">
<button id="1" onclick="digits('1')">1</button>
<button id="2" onclick="digits('2')">2</button>
<button id="3" onclick="digits('3')">3</button>
<button id="divide" onclick="setOperator('/')">÷</button>
</div>
<div class="row">
<button id="0" onclick="digits('0')">0</button>
<button id="dot" onclick="dot()">.</button>
<button id="exec" onclick="makeCalculation()">=</button>
<button id="multiply" onclick="setOperator('*')">x</button>
</div>
</div>
</div>
<script type="text/javascript" src="index.js"></script>
</body>
</html>