-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
45 lines (45 loc) · 2.35 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CALCULATOR IN BROWSER</title>
<link rel="stylesheet" href="./calc.css">
<script src="./calc.js"></script>
</head>
<body>
<div class="container" align="center">
<h1 id="heading">CALCULATOR</h1>
<form name="forms">
<div class="calcButtons">
<input type="text" name="screen" id="answerBox">
<br>
<input type="button" value="7" onclick="forms.screen.value+=('7')">
<input type="button" value="8" onclick="forms.screen.value+=('8')">
<input type="button" value="9" onclick="forms.screen.value+=('9')">.
<input type="button" value="AC" onclick="forms.screen.value = ('')">
<br>
<input type="button" value="4" onclick="forms.screen.value+=('4')">
<input type="button" value="5" onclick="forms.screen.value+=('5')">
<input type="button" value="6" onclick="forms.screen.value+=('6')">
<input type="button" value="+" onclick="forms.screen.value+=('+')">
<br>
<input type="button" value="1" onclick="forms.screen.value+=('1')">
<input type="button" value="2" onclick="forms.screen.value+=('2')">
<input type="button" value="3" onclick="forms.screen.value+=('3')">
<input type="button" value="-" onclick="forms.screen.value+='-'">
<br>
<input type="button" value="." onclick="forms.screen.value+=('.')">
<input type="button" value="0" onclick="forms.screen.value+=('0')">
<input type="button" value="/" onclick="forms.screen.value+=('/')">
<input type="button" value="*" onclick="forms.screen.value+=('*')">
<br>
<input type="button" value="(" onclick="forms.screen.value+=('(')">
<input type="button" value=")" onclick="forms.screen.value+=(')')">
<input type="button" value="%" onclick="forms.screen.value+=('%')">
<input type="button" value="=" onclick="forms.screen.value = eval(forms.screen.value)">
</div>
</form>
</div>
</body>
</html>