-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalctest.html
More file actions
52 lines (51 loc) · 2.37 KB
/
Copy pathcalctest.html
File metadata and controls
52 lines (51 loc) · 2.37 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>calculator</title>
<style>
#calculator * {font-size: 16px;}
#calculator table {border: solid 3px silver; border-spacing: 3px; background-color: #EEE; }
#calculator table td {border-spacing: 3px;}
input.display {width: 166px; text-align: right;}
td.buttons {border-top: solid 1px silver;}
input[type= button] {width: 40px; height: 30px;}
</style>
</head>
<body>
<form name="calc" id="calculator">
<table>
<tr>
<td>
<input type="text" name="input" size="16" class="display">
</td>
</tr>
<tr>
<td class="buttons">
<input type="button" name="one" value="1" OnClick="calc.input.value += '1'">
<input type="button" name="two" value="2" OnClick="calc.input.value += '2'">
<input type="button" name="three" value="3" OnClick="calc.input.value += '3'">
<input type="button" name="add" value="+" OnClick="calc.input.value += '+'">
<br>
<input type="button" name="four" value="4" OnClick="calc.input.value += '4'">
<input type="button" name="five" value="5" OnClick="calc.input.value += '5'">
<input type="button" name="six" value="6" OnClick="calc.input.value += '6'">
<input type="button" name="sub" value="-" OnClick="calc.input.value += '-'">
<br>
<input type="button" name="seven" value="7" OnClick="calc.input.value += '7'">
<input type="button" name="eight" value="8" OnClick="calc.input.value += '8'">
<input type="button" name="nine" value="9" OnClick="calc.input.value += '9'">
<input type="button" name="mul" value="x" OnClick="calc.input.value += '*'">
<br>
<input type="button" name="clear" value="c" OnClick="calc.input.value = ''">
<input type="button" name="zero" value="0" OnClick="calc.input.value += '0'">
<input type="button" name="doit" value="=" OnClick="calc.input.value = eval(calc.input.value)">
<input type="button" name="div" value="/" OnClick="calc.input.value += '/'">
</td>
</tr>
</table>
</form>
</body>
</html>