-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
44 lines (41 loc) · 2.29 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
<!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">
<link rel="stylesheet" href="styles.css">
<title>Calculator</title>
</head>
<body>
<div id="container">
<div id="appBg">
<h1>Simple Calculator</h1>
<form name="calculator">
<input type="textfield" name="ans" value="" autocomplete="off" readonly>
<input type="button" value="7" onclick="document.calculator.ans.value+='7'" class="orange">
<input type="button" value="8" onclick="document.calculator.ans.value+='8'" class="orange">
<input type="button" value="9" onclick="document.calculator.ans.value+='9'" class="orange">
<input type="button" value="+" onclick="document.calculator.ans.value+='+'" class="gray">
<br>
<input type="button" value="4" onclick="document.calculator.ans.value+='4'" class="orange">
<input type="button" value="5" onclick="document.calculator.ans.value+='5'" class="orange">
<input type="button" value="6" onclick="document.calculator.ans.value+='6'" class="orange">
<input type="button" value="-" onclick="document.calculator.ans.value+='-'" class="gray">
<br>
<input type="button" value="1" onclick="document.calculator.ans.value+='1'" class="orange">
<input type="button" value="2" onclick="document.calculator.ans.value+='2'" class="orange">
<input type="button" value="3" onclick="document.calculator.ans.value+='3'" class="orange">
<input type="button" value="x" onclick="document.calculator.ans.value+='*'" class="gray">
<br>
<input type="button" value="0" onclick="document.calculator.ans.value+='0'" class="orange">
<input type="reset" value="C">
<input type="button" value="=" onclick="document.calculator.ans.value=eval(document.calculator.ans.value)">
<input type="button" value="/" onclick="document.calculator.ans.value+='/'" class="gray">
</form>
</div>
</div>
<script>
</script>
</body>
</html>