-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (65 loc) · 4.4 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Javascript Calculator</title>
<link rel="stylesheet" href="style.css">
<script src="calculator.js"></script>
</head>
<body>
<div class="main">
<div class="calculator">
<form name="forms" class="forms">
<div class="screen">
<input type="text" name="input" class=" form-control" id="input" placeholder="ON" autocomplete="off"
onkeypress="isInputNumber(event)">
<div class="input-group">
<input type="text" id="helper" class="form-control" readonly="true">
<input type="text" name="answers" class="form-control" placeholder="ANSWER" readonly="readonly"
id="answers">
<span class="clear"></span>
</div>
</div>
<div class="buttons">
<div class="btns main-buttons">
<button type="button" id="clear" onclick="cler()">AC</button>
<button type="button" id="backspace" onclick="backSpace()">C</button>
<button type="button" id="devide" class="color" onclick="forms.input.value +='/'">/</button>
<button type="button" class="sci-btn" onclick="calc('sin')">Sin</button>
<button type="button" class="sci-btn" onclick="calc('cos')">Cos</button>
<button type="button" class="sci-btn" onclick="calc('tan')">Tan</button>
<button type="button" onclick="forms.input.value +='7'">7</button>
<button type="button" onclick="forms.input.value +='8'">8</button>
<button type="button" onclick="forms.input.value +='9'">9</button>
<button type="button" class="color" id="multiply" onclick="forms.input.value +='*'">*</button>
<button type="button" class="sci-btn" onclick="calc('sin-')">Sin<sup>-1</sup> </button>
<button type="button" class="sci-btn" onclick="calc('cos-')">Cos<sup>-1</sup></button>
<button type="button" class="sci-btn" onclick="calc('tan-')">Tan<sup>-1</sup></button>
<button type="button" onclick="forms.input.value +='4'">4</button>
<button type="button" onclick="forms.input.value +='5'">5</button>
<button type="button" onclick="forms.input.value +='6'">6</button>
<button type="button" class="color" id="multiply" onclick="forms.input.value +='-'">-</button>
<button type="button" class="sci-btn" onclick="calc('log10')">log<sub><sub>10</sub></sub></button>
<button type="button" class="sci-btn" onclick="calc('log')">log</button>
<button type="button" class="sci-btn" onclick="calc('log-')">log<sup>-1</sup></button>
<button type="button" onclick="forms.input.value +='1'">1</button>
<button type="button" onclick="forms.input.value +='2'">2</button>
<button type="button" onclick="forms.input.value +='3'">3</button>
<button type="button" class="color" onclick="forms.input.value +='+'">+</button>
<button type="button" class="sci-btn" onclick="calc('root')">√</button>
<button type="button" class="sci-btn" onclick="forms.input.value +='3.14159265359'">π</button>
<button type="button" class="sci-btn" onclick="calc('square')">X<sup><sup>2</sup></sup></button>
<button type="button" onclick="forms.input.value +='0'">0</button>
<button type="button" id="desimal" onclick="forms.input.value +='.'">.</button>
<button type="button" class="color" id="equal" onclick="forms.answers.value= eval(forms.input.value)">=</button>
<button type="button" class="sci-btn" onclick="calc('third')">X<sup><sup>3</sup></sup></button>
<button type="button" class="sci-btn" onclick="forms.input.value +='**'">X <sup><sup>y</sup></sup></button>
<button type="button" class="sci-btn" onclick="swp()">Ans+</button>
</div>
</div>
</form>
</div>
</div>
</body>
</html>