-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcalc.html
More file actions
77 lines (71 loc) · 2.78 KB
/
calc.html
File metadata and controls
77 lines (71 loc) · 2.78 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<html >
<head>
<title>CALCULATOR</title>
<script type="text/javascript">
function get_value(e){
if(e=='c'){
calc.display.value=""
}
else if(e=='='){
calc.display.value=eval(calc.display.value)
}
else{
calc.display.value+=e
}
}
</script>
<style>
td{
text-align: center;
}
input{
color: black;
font-size: 15px;
}
.display{
text-align: center;
font-size: 20px;
font-weight: bold;
color: blue;
height: 50px;
}
</style>
</head>
<body>
<center>
<form name="calc">
<table border="1">
<tr>
<td colspan="4" >
<input type="text" name="display" class="display">
</td>
</tr>
<tr>
<td><input type="button" value="1" onclick="get_value(1)"></td>
<td><input type="button" value="2" onclick="get_value(2)"></td>
<td><input type="button" value="3" onclick="get_value(3)"></td>
<td><input type="button" value="+" onclick="get_value('+')"></td>
</tr>
<tr>
<td><input type="button" value="4" onclick="get_value(4)"></td>
<td><input type="button" value="5" onclick="get_value(5)"></td>
<td><input type="button" value="6" onclick="get_value(6)"></td>
<td><input type="button" value="-" onclick="get_value('-')"></td>
</tr>
<tr>
<td><input type="button" value="7" onclick="get_value(7)"></td>
<td><input type="button" value="8" onclick="get_value(8)"></td>
<td><input type="button" value="9" onclick="get_value(9)"></td>
<td><input type="button" value="*" onclick="get_value('*')"></td>
</tr>
<tr>
<td><input type="button" value="/" onclick="get_value('/')"></td>
<td><input type="button" value="0" onclick="get_value(0)"></td>
<td><input type="button" value="clr" onclick="get_value('c')"></td>
<td><input type="button" value="=" onclick="get_value('=')"></td>
</tr>
</table>
</form>
</center>
</body>
</html>