-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
32 lines (32 loc) · 1.87 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
<!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> simple calculator</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>Simple Calculator</h1>
<form id="calform" name="cal">
<input name="display" style="width: 675px; height: 100px; text-align: center; background-color: #1f80c9;"><br/>
<input type="button" value="1" onclick="cal.display.value+=1">
<input type="button" value="2" onclick="cal.display.value+=2">
<input type="button" value="3" onclick="cal.display.value+=3">
<input type="button" value="+" onclick="cal.display.value+='+'" style="background-color: #cc5c11;"><br/>
<input type="button" value="4" onclick="cal.display.value+=4">
<input type="button" value="5" onclick="cal.display.value+=5">
<input type="button" value="6" onclick="cal.display.value+=6">
<input type="button" value="-" onclick="cal.display.value+='-'" style="background-color: #81753d;"><br/>
<input type="button" value="7" onclick="cal.display.value+=7">
<input type="button" value="8" onclick="cal.display.value+=8">
<input type="button" value="9" onclick="cal.display.value+=9">
<input type="button" value="*" onclick="cal.display.value+='*'" style="background-color: #11992f;"><br/>
<input type="button" value="C" onclick="cal.display.value =''" style="background-color: rgb(68, 68, 184);">
<input type="button" value="0" onclick="cal.display.value+=0">
<input type="button" value="=" onclick="cal.display.value =eval(cal.display.value)" style="background-color: #b8d82a;">
<input type="button" value="÷" onclick="cal.display.value+='/'" style="background-color: #fa7ea7;">
</form>
</body>
</html>