Rev 5787 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5787 | Rev 6576 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"> |
|
- | 2 | <html> |
|
- | 3 | <head> |
|
- | 4 | <style type="text/css"> |
|
- | 5 | .input, .number, .operation, .clear, .equal {font-size:22px;height:50px;} |
|
- | 6 | .number, .operation, .clear, .exit {width:50px;} |
|
- | 7 | .equal {width:120px;background-color:lightgreen;} |
|
- | 8 | .input {background-color:lightgreen;width:200px;} |
|
- | 9 | .result {background-color:lightgreen;width:150px;} |
|
- | 10 | .number {} |
|
- | 11 | .operation{background-color:#ccffff} |
|
- | 12 | .clear {background-color:orange} |
|
- | 13 | .exit{ background-color:red;color:black;font-size:12px;} |
|
- | 14 | table.calc {border:4px solid blue; margin-left:auto;margin-right:auto; |
|
- | 15 | text-align:center; border-collapse:collapse;} |
|
- | 16 | table.calc td {width:50px;} |
|
- | 17 | </style> |
|
- | 18 | </head> |
|
- | 19 | <body> |
|
1 | 20 | ||
2 | <html><body> |
- | |
3 | <center> |
- | |
4 | < |
21 | <form id="calc"> |
5 | 22 | ||
6 | <!-- This script and many more are available free online at --> |
23 | <!-- This script and many more are available free online at --> |
7 | <!-- The JavaScript Source!! http://javascript.internet.com --> |
24 | <!-- The JavaScript Source!! http://javascript.internet.com --> |
8 | 25 | ||
9 | < |
26 | <table class="calc"> |
10 | <tr> |
27 | <tr> |
- | 28 | <td colspan="3"> |
|
- | 29 | <input type="text" name="input" class="input" /> |
|
- | 30 | </td><td><input type="button" name="exit" class="exit" value="Exit" onclick="javascript:window.close()" /> |
|
11 | <td> |
31 | </td> |
- | 32 | </tr><tr> |
|
- | 33 | <td colspan="3"> |
|
12 | < |
34 | <input type="text" name="result" class="input" /> |
- | 35 | </td> |
|
- | 36 | </tr> |
|
- | 37 | ||
- | 38 | </tr> |
|
- | 39 | <tr><td> |
|
- | 40 | <input type="button" name="left" class="number" value=" ( " onclick="calc.input.value += '('"> |
|
- | 41 | </td> |
|
- | 42 | <td> |
|
- | 43 | <input type="button" name="right" class="number" value=" ) " onclick="calc.input.value += ')'"> |
|
13 | < |
44 | </td> |
- | 45 | <td> |
|
- | 46 | <input type="button" name="clear" class="clear" value=" C " onclick="calc.input.value = ''; calc.result.value = ''"> |
|
- | 47 | </td><td> |
|
- | 48 | <input type="button" name="div" class="operation" value=" ÷ " onclick="calc.input.value += ' / '"> |
|
14 | </td> |
49 | </td> |
15 | </tr> |
50 | </tr> |
16 | <tr> |
51 | <tr> |
17 | <td> |
52 | <td> |
18 | < |
53 | <input type="button" name="one" class="number" value=" 7 " onclick="calc.input.value += '7'"> |
- | 54 | </td><td> |
|
19 | < |
55 | <input type="button" name="two" class="number" value=" 8 " onclick="calc.input.value += '8'"> |
- | 56 | </td><td> |
|
20 | < |
57 | <input type="button" name="three" class="number" value=" 9 " onclick="calc.input.value += '9'"> |
- | 58 | </td><td> |
|
21 | < |
59 | <input type="button" name="plus" class="operation" value=" x " onclick="calc.input.value += ' * '"> |
22 | < |
60 | </td></tr><tr><td> |
23 | < |
61 | <input type="button" name="four" class="number" value=" 4 " onclick="calc.input.value += '4'"> |
- | 62 | </td><td> |
|
24 | < |
63 | <input type="button" name="five" class="number" value=" 5 " onclick="calc.input.value += '5'"> |
- | 64 | </td><td> |
|
25 | < |
65 | <input type="button" name="six" class="number" value=" 6 " onclick="calc.input.value += '6'"> |
- | 66 | </td><td> |
|
26 | < |
67 | <input type="button" name="minus" class="operation" value=" - " onclick="calc.input.value += ' - '"> |
27 | < |
68 | </td> |
- | 69 | ||
- | 70 | </tr><tr><td> |
|
28 | < |
71 | <input type="button" name="seven" class="number" value=" 1 " onclick="calc.input.value += '1'"> |
- | 72 | </td><td> |
|
29 | < |
73 | <input type="button" name="eight" class="number" value=" 2 " onclick="calc.input.value += '2'"> |
- | 74 | </td><td> |
|
30 | < |
75 | <input type="button" name="nine" class="number" value=" 3 " onclick="calc.input.value += '3'"> |
- | 76 | </td><td> |
|
31 | < |
77 | <input type="button" name="times" class="operation" value=" + " onclick="calc.input.value += ' + '"> |
32 | < |
78 | </td> |
33 | < |
79 | </tr><tr><td> |
34 | < |
80 | <input type="button" name="zero" class="number" value=" 0 " onclick="calc.input.value += '0'"> |
35 | <INPUT TYPE="button" NAME="DoIt" VALUE=" = " OnClick="Calc.Input.value = eval(Math.round(eval(Calc.Input.value)*(Math.pow(10,12)))/(Math.pow(10,12)))"> |
- | |
- | 81 | </td> |
|
- | 82 | <td> |
|
36 | < |
83 | <input type="button" name="point" class="number" value=" , " onclick="calc.input.value += '.'"> |
37 | < |
84 | </td> |
- | 85 | <td colspan="2"> |
|
- | 86 | <input type="button" name="doit" class="equal" value=" = " |
|
- | 87 | onclick="calc.result.value = eval(Math.round(eval(calc.input.value)*(Math.pow(10,12)))/(Math.pow(10,12)))"> |
|
38 | </td> |
88 | </td> |
39 | </tr> |
89 | </tr> |
40 | </ |
90 | </table> |
41 | </ |
91 | </form> |
42 | </center> |
- | |
43 | 92 | ||
44 | <!-- <p><center> |
93 | <!-- <p><center> |
45 | <font face="arial, helvetica" size="-2">Free JavaScripts provided<br/> |
94 | <font face="arial, helvetica" size="-2">Free JavaScripts provided<br /> |
46 | by <a href="http://javascriptsource.com">The JavaScript Source</a></font> |
95 | by <a href="http://javascriptsource.com">The JavaScript Source</a></font> |
47 | </center><p> --> |
96 | </center><p> --> |
48 | 97 | ||
49 | </body></html> |
98 | </body></html> |