-
Notifications
You must be signed in to change notification settings - Fork 164
/
Calculator Using Javascript.js
49 lines (45 loc) · 2.62 KB
/
Calculator Using Javascript.js
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
<html lang="en">
<head>
<meta charset="utf-8">
<title>JavaSctipt Calculator</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div class="container">
<form name="calculatorForm">
<div class="resultscreen">
<div class="heading">Live Calculator</div>
<input type="text" name="evalresult"/>
</div>
<div class="buttons">
<div class="line">
<input type="button" name="inpButton7" value="7" onClick="fullCalc(inpButton7.value)"/>
<input type="button" name="inpButton8" value="8" onClick="fullCalc(inpButton8.value)"/>
<input type="button" name="inpButton9" value="9" onClick="fullCalc(inpButton9.value)"/>
<input type="button" name="inpButtondivision" value="/" onClick="fullCalc(inpButtondivision.value)"/>
</div>
<div class="line">
<input type="button" name="inpButton4" value="4" onClick="fullCalc(inpButton4.value)"/>
<input type="button" name="inpButton5" value="5" onClick="fullCalc(inpButton5.value)"/>
<input type="button" name="inpButton6" value="6" onClick="fullCalc(inpButton6.value)"/>
<input type="button" name="inpButtonmultiply" value="*" onClick="fullCalc(inpButtonmultiply.value)"/>
</div>
<div class="line">
<input type="button" name="inpButton1" value="1" onClick="fullCalc(inpButton1.value)"/>
<input type="button" name="inpButton2" value="2" onClick="fullCalc(inpButton2.value)"/>
<input type="button" name="inpButton3" value="3" onClick="fullCalc(inpButton3.value)"/>
<input type="button" name="inpButtonsubtract" value="-" onClick="fullCalc(inpButtonsubtract.value)"/>
</div>
<div class="line">
<input type="button" name="inpButton0" value="0" onClick="fullCalc(inpButton0.value)"/>
<input type="button" name="inpButtonDot" value="." onClick="fullCalc(inpButtonDot.value)"/>
<input type="button" name="inpButtonAddition" value="+" onClick="fullCalc(inpButtonAddition.value)"/>
<input type="button" name="result" value="=" onClick="evalresult.value=eval(evalresult.value)"/>
</div>
</div>
</form>
</div>
<script src="script.js"></script>
</body>
</html>