File: basicalc.html

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (98 lines) | stat: -rw-r--r-- 3,658 bytes parent folder | download | duplicates (8)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html>
<head>
<style type="text/css">
.input, .number, .operation, .clear, .equal {font-size:22px;height:50px;}
.number, .operation, .clear, .exit {width:50px;}
.equal {width:120px;background-color:lightgreen;}
.input {background-color:lightgreen;width:200px;}
.result {background-color:lightgreen;width:150px;}
.number {}
.operation{background-color:#ccffff}
.clear {background-color:orange}
.exit{ background-color:red;color:black;font-size:12px;}
table.calc {border:4px solid blue; margin-left:auto;margin-right:auto;
  text-align:center; border-collapse:collapse;}
table.calc td {width:50px;}
</style>
</head>
<body>

<form id="calc">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<table class="calc">
<tr>
<td colspan="3">
<input type="text" name="input" class="input" />
</td><td><input type="button" name="exit" class="exit" value="Exit" onclick="javascript:window.close()" />
</td>
</tr><tr>
<td colspan="3">
<input type="text" name="result" class="input" readonly="readonly" />
</td>
</tr>

</tr>
<tr><td>
<input type="button" name="left" class="number"  value="  (  " onclick="calc.input.value += '('">
</td>
<td>
<input type="button" name="right" class="number"  value="  )  " onclick="calc.input.value += ')'">
</td>
<td>
<input type="button" name="clear" class="clear" value="  C  " onclick="calc.input.value = ''; calc.result.value = ''">
</td><td>
<input type="button" name="div" class="operation" value="  &#247;  " onclick="calc.input.value += ' / '">
</td>
</tr>
<tr>
<td>
<input type="button" name="one"  class="number" value="  7  " onclick="calc.input.value += '7'">
</td><td>
<input type="button" name="two" class="number"  value="  8  " onclick="calc.input.value += '8'">
</td><td>
<input type="button" name="three" class="number" value="  9  " onclick="calc.input.value += '9'">
</td><td>
<input type="button" name="plus" class="operation" value="  x  " onclick="calc.input.value += ' * '">
</td></tr><tr><td>
<input type="button" name="four" class="number" value="  4  " onclick="calc.input.value += '4'">
</td><td>
<input type="button" name="five" class="number" value="  5  " onclick="calc.input.value += '5'">
</td><td>
<input type="button" name="six"  class="number" value="  6  " onclick="calc.input.value += '6'">
</td><td>
<input type="button" name="minus" class="operation" value="  -  " onclick="calc.input.value += ' - '">
</td>

</tr><tr><td>
<input type="button" name="seven" class="number" value="  1  " onclick="calc.input.value += '1'">
</td><td>
<input type="button" name="eight" class="number" value="  2 " onclick="calc.input.value += '2'">
</td><td>
<input type="button" name="nine" class="number" value="  3  " onclick="calc.input.value += '3'">
</td><td>
<input type="button" name="times" class="operation" value="  +  " onclick="calc.input.value += ' + '">
</td>
</tr><tr><td>
<input type="button" name="zero" class="number"  value="  0  " onclick="calc.input.value += '0'">
</td>
<td>
<input type="button" name="point" class="number"  value="  ,  " onclick="calc.input.value += '.'">
</td>
<td colspan="2">
<input type="button" name="doit" class="equal" value="  =  " 
onclick="calc.result.value = eval(Math.round(eval(calc.input.value)*(Math.pow(10,12)))/(Math.pow(10,12)))">
</td>
</tr>
</table>
</form>

<!-- <p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br />
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p> -->

</body></html>