-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (46 loc) · 2.88 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="keywords" content="html">
<meta name="style" content="css">
<title>Calculator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="cal-box">
<form name="calc" class="calc">
<!-- display for answer -->
<input type="display" class="display" name="input" placeholder="0" size="14">
<br>
<!-- keys and operators -->
<div class="button1">
<input class="button keys 1" type="button" name="one" value="1" onclick="calc.input.value+='1'" />
<input class="button keys 2" type="button" name="two" value="2" onclick="calc.input.value+='2'" />
<input class="button keys 3" type="button" name="three" value="3" onclick="calc.input.value+='3'" />
<input type="button" class="button operator plus" name="plus" value=" + " onclick="calc.input.value+=' + '" />
<br>
<input class="button keys 4" type="button" name="four" value="4" onclick="calc.input.value+='4'" />
<input class="button keys 5" type="button" name="five" value="5" onclick="calc.input.value+='5'" />
<input class="button keys 6" type="button" name="six" value="6" onclick="calc.input.value+='6'" />
<input type="button" class="button operator minus" name="minus" value=" - " onclick="calc.input.value+=' - '" />
<br>
<input class="button keys 7 btn" type="button" name="seven" value="7" onclick="calc.input.value+='7'" />
<input class="button keys 8 btn" type="button" name="eight" value="8" onclick="calc.input.value+='8'" />
<input class="button keys 9 btn" type="button" name="nine" value="9" onclick="calc.input.value+='9'" />
<input type="button" class="button operator multiple" name="multiplication" value=" × " onclick="calc.input.value+=' * '" />
<br>
<input type="button" name="clear" class="button clear keys" value="C" onclick="calc.input.value = ''">
<!-- clr function will clear values -->
<input class="button keys zero last btn" type="button" name="zero" value="0" onclick="calc.input.value+='0'" />
<input class="button equal keys last" type="button" name="equal" value="=" onclick="calc.input.value=eval(calc.input.value)" />
<input type="button" class="button operator divide last btn" name="divide" value=" ÷ " onclick="calc.input.value+=' / '" />
</div>
</div>
</form>
</div>
</div>
</body>
</html>