-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCALC.HTML
52 lines (38 loc) · 2 KB
/
CALC.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
<!DOCTYPE HTML>
<html>
<head>
<title>Calculator</title>
<script type="text/javascript" src="calc.js"></script>
<link rel="stylesheet" type="text/css" href="calc.css">
<link href="https://fonts.googleapis.com/css?family=Hammersmith+One|Playfair+Display|Source+Sans+Pro|" rel="stylesheet">
</head>
<body>
<h1>Simple Calculator</h1>
<form name="calculator" id="calc">
<input type="alphanumeric" name="ans" id="inpbar">
<br><br>
<button type="button" value="7" onClick="document.calculator.ans.value+='7'">7</button>
<button type="button" value="8" onClick="document.calculator.ans.value+='8'">8</button>
<button type="button" value="9" onClick="document.calculator.ans.value+='9'">9</button>
<input type="button" value=" - " onClick="document.calculator.ans.value+='-'">
<br>
<button type="button" value="4" onClick="document.calculator.ans.value+='4'">4</button>
<button type="button" value="5" onClick="document.calculator.ans.value+='5'">5</button>
<button type="button" value="6" onClick="document.calculator.ans.value+='6'">6</button>
<input type="button" value=" +" onClick="document.calculator.ans.value+='+'">
<br>
<button type="button" value="1" onClick="document.calculator.ans.value+='1'">1</button>
<button type="button" value="2" onClick="document.calculator.ans.value+='2'">2</button>
<button type="button" value="3" onClick="document.calculator.ans.value+='3'">3</button>
<input type="button" value=" * " onClick="document.calculator.ans.value+='*'">
<br>
<button type="button" value="0" onClick="document.calculator.ans.value+='0'">0</button>
<input type="reset" value="C" onClick="document.calculator.ans.value=''">
<input type="button" value=" ." onClick="document.calculator.ans.value+='.'">
<input type="button" value=" / " onClick="document.calculator.ans.value+='/'">
<br>
<input type="button" value=" Ans " onClick="document.calculator.ans.value=eval(document.calculator.ans.value)">
<input type="button" value="OFF" onClick="off()">
</form>
</body>
</html>