-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
66 lines (59 loc) · 4.58 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
<!DOCTYPE html>
<html>
<head>
<title>JS Calculator</title>
<link rel="stylesheet" type="text/css" href="calstyle.css">
<script type="text/javascript" src="calc.js"></script>
</head>
<body>
<form name="scientfic-calculator">
<form align="center">
<table class="layout" cellspacing="0" cellpadding="1">
<tr>
<td colspan="5"><input id="display" name="display" value="0" size="28" maxlength="25"></td>
</tr>
<tr>
<td><input type="button" class="btn btn-danger" name="btn-danger" value="C" onclick="this.form.display.value= 0 "></td>
<td><input type="button" class="btn btn-danger" name="btn-danger" value="<--" onclick="deleteChar(this.form.display)"></td>
<td><input type="button" class="btn btn-danger" name="btn-danger" value="=" onclick="if(checkNum(this.form.display.value)) { compute(this.form) }"></td>
<td><input type="button" class="btn btn-operations" name="btn-operations" value="π" onclick="addChar(this.form.display,'3.14159265359')"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="%" onclick=" percent(this.form.display)"></td>
</tr>
<tr>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="7" onclick="addChar(this.form.display, '7')"></td>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="8" onclick="addChar(this.form.display, '8')"></td>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="9" onclick="addChar(this.form.display, '9')"></td>
<td><input type="button" class="btn btn-operations" name="btn-operations" value="x^" onclick="if(checkNum(this.form.display.value)) { exp(this.form) }"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="/" onclick="addChar(this.form.display, '/')"></td>
<tr>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="4" onclick="addChar(this.form.display, '4')"></td>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="5" onclick="addChar(this.form.display, '5')"></td>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="6" onclick="addChar(this.form.display, '6')"></td>
<td><input type="button" class="btn btn-operations" name="btn-operations" value="ln" onclick="if(checkNum(this.form.display.value)) { ln(this.form) }"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="*" onclick="addChar(this.form.display, '*')"></td>
</tr>
<tr>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="1" onclick="addChar(this.form.display, '1')"></td>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="2" onclick="addChar(this.form.display, '2')"></td>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="3" onclick="addChar(this.form.display, '3')"></td>
<td><input type="button" class="btn btn-operations" name="btn-operations" value="√" onclick="if(checkNum(this.form.display.value)) { sqrt(this.form) }"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="-" onclick="addChar(this.form.display, '-')"></td>
</tr>
<tr>
<td><input type="button" class="btn btn-info" name="btn-info" value="±" onclick="changeSign(this.form.display)"></td>
<td><input type="button" class="btn btn-primary" name="btn-primary" value="0" onclick="addChar(this.form.display, '0')"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="." onclick="addChar(this.form.display, '.')"></td>
<td><input type="button" class="btn btn-operations" name="btn-operations" value="x2" onclick="if(checkNum(this.form.display.value)) { square(this.form) }"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="+" onclick="addChar(this.form.display, '+')"></td>
</tr>
<tr>
<td><input type="button" class="btn btn-info" name="btn-info" value="(" onclick="addChar(this.form.display, '(')"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value=")" onclick="addChar(this.form.display,')')"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="cos" onclick="if(checkNum(this.form.display.value)) { cos(this.form) }"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="sin" onclick="if(checkNum(this.form.display.value)) { sin(this.form) }"></td>
<td><input type="button" class="btn btn-info" name="btn-info" value="tan" onclick="if(checkNum(this.form.display.value)) { tan(this.form) }"></td>
</tr>
</table>
</form>
</body>
</html>