-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcalculator.html
More file actions
49 lines (39 loc) · 1.83 KB
/
calculator.html
File metadata and controls
49 lines (39 loc) · 1.83 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
<html>
<head><title>calculator</title>
</head>
<style>
.calculator{
padding:50px;
margin:50px;
}
.button{
width:15%;
}
.button1{
width:15%;
}
</style>
<body background="a.png">
<div class="calculator" style="width:20%;" >
<form name="forms" align="center"/>
<input type="text" name="result" /><br><br>
<input class="button" type="button" value="1" onclick="forms.result.value+='1'"/>
<input class="button" type="button" value="2" onclick="forms.result.value+='2'"/>
<input class="button" type="button" value="3" onclick="forms.result.value+='3'"/><br>
<input class="button" type="button" value="4" onclick="forms.result.value+='4'"/>
<input class="button" type="button" value="5" onclick="forms.result.value+='5'"/>
<input class="button" type="button" value="6" onclick="forms.result.value+='6'"/><br>
<input class="button" type="button" value="7" onclick="forms.result.value+='7'"/>
<input class="button" type="button" value="8" onclick="forms.result.value+='8'"/>
<input class="button" type="button" value="9" onclick="forms.result.value+='9'"/><br>
<input class="button" type="button" value="." onclick="forms.result.value+='.'"/>
<input class="button" type="button" value="0" onclick="forms.result.value+='0'"/>
<input class="button" type="button" value="=" onclick="forms.result.value=eval(forms.result.value)"/><br>
<input class="button1" type="button" value="+" onclick="forms.result.value+='+'"/>
<input class="button1" type="button" value="-" onclick="forms.result.value+='-'"/>
<input class="button1" type="button" value="*" onclick="forms.result.value+='*'"/><br>
<input class="button1" type="button" value="/" onclick="forms.result.value+='/'"/>
<input class="button" type="button" value="C" onclick="forms.result.value=null"/>
</div>
</body>
</html>