Rev 6576 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6576 | bpr | 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> |
||
20 | reyssat | 20 | |
6576 | bpr | 21 | <form id="calc"> |
20 | reyssat | 22 | |
23 | <!-- This script and many more are available free online at --> |
||
24 | <!-- The JavaScript Source!! http://javascript.internet.com --> |
||
25 | |||
6576 | bpr | 26 | <table class="calc"> |
20 | reyssat | 27 | <tr> |
6576 | bpr | 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()" /> |
||
31 | </td> |
||
32 | </tr><tr> |
||
33 | <td colspan="3"> |
||
6579 | bpr | 34 | <input type="text" name="result" class="input" readonly="readonly" /> |
6576 | bpr | 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> |
||
20 | reyssat | 42 | <td> |
6576 | bpr | 43 | <input type="button" name="right" class="number" value=" ) " onclick="calc.input.value += ')'"> |
20 | reyssat | 44 | </td> |
6576 | bpr | 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 += ' / '"> |
||
49 | </td> |
||
20 | reyssat | 50 | </tr> |
51 | <tr> |
||
52 | <td> |
||
6576 | bpr | 53 | <input type="button" name="one" class="number" value=" 7 " onclick="calc.input.value += '7'"> |
54 | </td><td> |
||
55 | <input type="button" name="two" class="number" value=" 8 " onclick="calc.input.value += '8'"> |
||
56 | </td><td> |
||
57 | <input type="button" name="three" class="number" value=" 9 " onclick="calc.input.value += '9'"> |
||
58 | </td><td> |
||
59 | <input type="button" name="plus" class="operation" value=" x " onclick="calc.input.value += ' * '"> |
||
60 | </td></tr><tr><td> |
||
61 | <input type="button" name="four" class="number" value=" 4 " onclick="calc.input.value += '4'"> |
||
62 | </td><td> |
||
63 | <input type="button" name="five" class="number" value=" 5 " onclick="calc.input.value += '5'"> |
||
64 | </td><td> |
||
65 | <input type="button" name="six" class="number" value=" 6 " onclick="calc.input.value += '6'"> |
||
66 | </td><td> |
||
67 | <input type="button" name="minus" class="operation" value=" - " onclick="calc.input.value += ' - '"> |
||
20 | reyssat | 68 | </td> |
6576 | bpr | 69 | |
70 | </tr><tr><td> |
||
71 | <input type="button" name="seven" class="number" value=" 1 " onclick="calc.input.value += '1'"> |
||
72 | </td><td> |
||
73 | <input type="button" name="eight" class="number" value=" 2 " onclick="calc.input.value += '2'"> |
||
74 | </td><td> |
||
75 | <input type="button" name="nine" class="number" value=" 3 " onclick="calc.input.value += '3'"> |
||
76 | </td><td> |
||
77 | <input type="button" name="times" class="operation" value=" + " onclick="calc.input.value += ' + '"> |
||
78 | </td> |
||
79 | </tr><tr><td> |
||
80 | <input type="button" name="zero" class="number" value=" 0 " onclick="calc.input.value += '0'"> |
||
81 | </td> |
||
82 | <td> |
||
83 | <input type="button" name="point" class="number" value=" , " onclick="calc.input.value += '.'"> |
||
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)))"> |
||
88 | </td> |
||
20 | reyssat | 89 | </tr> |
6576 | bpr | 90 | </table> |
91 | </form> |
||
20 | reyssat | 92 | |
93 | <!-- <p><center> |
||
6576 | bpr | 94 | <font face="arial, helvetica" size="-2">Free JavaScripts provided<br /> |
20 | reyssat | 95 | by <a href="http://javascriptsource.com">The JavaScript Source</a></font> |
96 | </center><p> --> |
||
97 | |||
98 | </body></html> |