-
Notifications
You must be signed in to change notification settings - Fork 0
/
Calculator.html
48 lines (42 loc) · 1.93 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Calculator!</title>
<link href="Calculator.css" rel="stylesheet"></link>
</head>
<body bgcolor="#580C1F">
<table>
<td><font size="10"><button onclick="clearInput()">C</button></td>
<td colspan="3"><center><input id="screenInput" type="text" value="" readonly></input></center></td>
<tr>
<td id="7"><button onclick="addNumberToInput('7')">7</button></td>
<td id="8"><button onclick="addNumberToInput('8')">8</button></td>
<td id="9"><button onclick="addNumberToInput('9')">9</button></td>
<td id="+"><button onclick="addOperatorToInput('+')">+</button></td>
<tr>
<td id="4"><button onclick="addNumberToInput('4')">4</button></td>
<td id="5"><button onclick="addNumberToInput('5')">5</button></td>
<td id="6"><button onclick="addNumberToInput('6')">6</button></td>
<td id="-"><button onclick="addOperatorToInput('-')">-</button></td>
<tr>
<td id="1"><button onclick="addNumberToInput('1')">1</button></td>
<td id="2"><button onclick="addNumberToInput('2')">2</button></td>
<td id="3"><button onclick="addNumberToInput('3')">3</button></td>
<td id="÷"><button onclick="addOperatorToInput('/')">÷</button></td>
<tr>
<td id="."><button onclick="addNumberToInput('.')">.</button></td>
<td id="0"><button onclick="addNumberToInput('0')">0</button></td>
<td id="="><button onclick="equalsInput('=')">=</button></td>
<td id="×"><button onclick="addOperatorToInput('*')">×</button></td>
</font>
</table>
</body>
<script src="Calculator.js"></script>
</html>
<!-- <button onclick="hello()">1</button>
<script>
function hello() {
console.log("Hello!");
}
(when the button is pushed, the console says hello!)
-->