Advertisement
vic_alexiev

Calculator.html

Oct 31st, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.19 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5.     <meta charset="utf-8" />
  6.     <title>Calculator</title>
  7.     <link rel="stylesheet" type="text/css" href="Calculator.css" />
  8. </head>
  9. <body>
  10.     <form name="keypad">
  11.         <table>
  12.             <tr>
  13.                 <td colspan="5">
  14.                     <input type="text" name="result" value="0" readonly="readonly" />
  15.                 </td>
  16.             </tr>
  17.  
  18.             <tr>
  19.                 <td class="cell-1x1">
  20.                     <input type="button" value="1" onclick="numPressed(1)" />
  21.                 </td>
  22.                 <td class="cell-1x1">
  23.                     <input type="button" value="2" onclick="numPressed(2)" />
  24.                 </td>
  25.                 <td class="cell-1x1">
  26.                     <input type="button" value="3" onclick="numPressed(3)" />
  27.                 </td>
  28.                 <td class="cell-1x1">
  29.                     <input type="button" value="+" onclick="operation('+')" />
  30.                 </td>
  31.                 <td class="cell-1x1">
  32.                     <input type="button" value="C" onclick="clearAll()" />
  33.                 </td>
  34.             </tr>
  35.  
  36.             <tr>
  37.                 <td class="cell-1x1">
  38.                     <input type="button" value="4" onclick="numPressed(4)" />
  39.                 </td>
  40.                 <td class="cell-1x1">
  41.                     <input type="button" value="5" onclick="numPressed(5)" />
  42.                 </td>
  43.                 <td class="cell-1x1">
  44.                     <input type="button" value="6" onclick="numPressed(6)" />
  45.                 </td>
  46.                 <td class="cell-1x1">
  47.                     <input type="button" value="-" onclick="operation('-')" />
  48.                 </td>
  49.                 <td class="cell-1x1">
  50.                     <input type="button" value="CE" onclick="clearEntry()" />
  51.                 </td>
  52.             </tr>
  53.  
  54.             <tr>
  55.                 <td class="cell-1x1">
  56.                     <input type="button" value="7" onclick="numPressed(7)" />
  57.                 </td>
  58.                 <td class="cell-1x1">
  59.                     <input type="button" value="8" onclick="numPressed(8)" />
  60.                 </td>
  61.                 <td class="cell-1x1">
  62.                     <input type="button" value="9" onclick="numPressed(9)" />
  63.                 </td>
  64.                 <td class="cell-1x1">
  65.                     <input type="button" value="*" onclick="operation('*')" />
  66.                 </td>
  67.                 <td class="cell-2x1" rowspan="2">
  68.                     <input type="button" value="=" onclick="operation('=')" />
  69.                 </td>
  70.             </tr>
  71.  
  72.             <tr>
  73.                 <td colspan="2">
  74.                     <input type="button" value="0" onclick="numPressed(0)" />
  75.                 </td>
  76.                 <td class="cell-1x1">
  77.                     <input type="button" value="." onclick="decimal()" />
  78.                 </td>
  79.                 <td class="cell-1x1">
  80.                     <input type="button" value="/" onclick="operation('/')" />
  81.                 </td>
  82.             </tr>
  83.         </table>
  84.     </form>
  85.     <script type="text/javascript" src="Calculator.js"></script>
  86. </body>
  87. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement