-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.html
60 lines (58 loc) · 2.25 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
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#clear{
width: 127px;
}
.formstyle{
width: 130px;
height: 265px;
margin: auto;
border: 2px solid black;
}
input{
width: 40px;
background-color: blue;
color: white;
}
#answerstyle{
width: 120px;
background-color: azure;
color: black;
}
</style>
</head>
<body>
<div class="formstyle">
<form name="forms">
<input type="text" name="answers" id="answerstyle"> <br> <br>
<input type="button" value=" 1 " onclick="forms.answers.value +='1'">
<input type="button" value=" 2 " onclick="forms.answers.value +='2'">
<input type="button" value=" 3 " onclick="forms.answers.value +='3'">
<br> <br>
<input type="button" value=" 4 " onclick="forms.answers.value +='4'">
<input type="button" value=" 5 " onclick="forms.answers.value +='5'">
<input type="button" value=" 6 " onclick="forms.answers.value +='6'">
<br> <br>
<input type="button" value=" 7 " onclick="forms.answers.value +='7'">
<input type="button" value=" 8 " onclick="forms.answers.value +='8'">
<input type="button" value=" 9 " onclick="forms.answers.value +='9'">
<br> <br>
<input type="button" value=" + " onclick="forms.answers.value +='+'">
<input type="button" value=" - " onclick="forms.answers.value +='-'">
<input type="button" value=" * " onclick="forms.answers.value +='*'">
<br> <br>
<input type="button" value=" / " onclick="forms.answers.value +='/'">
<input type="button" value=" 0 " onclick="forms.answers.value +='0'">
<input type="button" value=" = " onclick="forms.answers.value =eval(forms.answers.value)">
<br><br>
<input type="button" value="Clear All" onclick="forms.answers.value=''" id="clear">
</form>
</div>
</body>
</html>