-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc.html
49 lines (45 loc) · 1.73 KB
/
calc.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Simple Calculator</title>
</head>
<body>
<h1>Simple Calculator</h1>
<div class = "calc">
<table border="1">
<tr>
<td colspan="4"><input type="text" id="display" enabled ></td>
</tr>
<tr>
<td><button onclick="appendValue('1')" class = "1" >1</button></td>
<td><button onclick="appendValue('2')" class = "2" >2</button></td>
<td><button onclick="appendValue('3')" class = "3" >3</button></td>
<td><button onclick="appendValue('+')" class = "+" >+</button></td>
</tr>
<tr>
<td><button onclick="appendValue('4')" class = "4" >4</button></td>
<td><button onclick="appendValue('5')" class = "5" >5</button></td>
<td><button onclick="appendValue('6')" class = "6" >6</button></td>
<td><button onclick="appendValue('-')" class = "-" >-</button></td>
</tr>
<tr>
<td><button onclick="appendValue('7')" class = "7" >7</button></td>
<td><button onclick="appendValue('8')" class = "8" >8</button></td>
<td><button onclick="appendValue('9')" class = "9" >9</button></td>
<td><button onclick="appendValue('*')" class = "*" >*</button></td>
</tr>
<tr>
<td><button onclick="appendValue('0')" class = "0" >0</button></td>
<td><button onclick="clearDisplay()" class = "C" >C</button></td>
<td><button onclick="calculate()" class = "=" >=</button></td>
<td><button onclick="appendValue('/')" class = "/" >/</button></td>
</tr>
</table>
</div>
<script src = "index.js">
</script>
</body>
</html>