-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
38 lines (35 loc) · 1.61 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Basic Calculator</title>
</head>
<body>
<h2>Basic Calculator</h2>
<div class="card">
<div class="card-body">
<form id="form" name="calc">
<input class="result" name="display"><br><br>
<input type="button" value="7" OnClick="calc.display.value+='7'">
<input type="button" value="8" OnClick="calc.display.value+='8'">
<input type="button" value="9" OnClick="calc.display.value+='9'">
<input type="button" value="+" OnClick="calc.display.value+='+'"><br>
<input type="button" value="4" OnClick="calc.display.value+='4'">
<input type="button" value="5" OnClick="calc.display.value+='5'">
<input type="button" value="6" OnClick="calc.display.value+='6'">
<input type="button" value="-" OnClick="calc.display.value+='-'"><br>
<input type="button" value="1" OnClick="calc.display.value+='1'">
<input type="button" value="2" OnClick="calc.display.value+='2'">
<input type="button" value="3" OnClick="calc.display.value+='3'">
<input type="button" value="*" OnClick="calc.display.value+='*'"><br>
<input type="button" value="0" OnClick="calc.display.value+='0'">
<input type="button" value="C" OnClick="calc.display.value=''" class="background-red-color">
<!-- The eval() function evaluetes or executes the argument -->
<input type="button" value="=" OnClick="calc.display.value=eval(calc.display.value)">
<input type="button" value="/" OnClick="calc.display.value+='/'">
</form>
</div>
</div>
</body>
</html>