Advertisement
ramses98

Untitled

Nov 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.29 KB | None | 0 0
  1. <html>
  2.    <head>
  3.    <body>
  4.       <form name="calculator">
  5.          <table>
  6.             <tr>
  7.                <td colspan="4">
  8.                   <input type="text" name="display" id="display" disabled>
  9.                </td>
  10.             </tr>
  11.             <tr>
  12.                <td><input type="button" name="one" value="1" onclick="calculator.display.value += '1'"></td>
  13.                <td><input type="button" name="two" value="2" onclick="calculator.display.value += '2'"></td>
  14.                <td><input type="button" name="three" value="3" onclick="calculator.display.value += '3'"></td>
  15.                <td><input type="button" class="operator" name="plus" value="+" onclick="calculator.display.value += '+'"></td>
  16.             </tr>
  17.             <tr>
  18.                <td><input type="button" name="four" value="4" onclick="calculator.display.value += '4'"></td>
  19.                <td><input type="button" name="five" value="5" onclick="calculator.display.value += '5'"></td>
  20.                <td><input type="button" name="six" value="6" onclick="calculator.display.value += '6'"></td>
  21.                <td><input type="button" class="operator" name="minus" value="-" onclick="calculator.display.value += '-'"></td>
  22.             </tr>
  23.             <tr>
  24.                <td><input type="button" name="seven" value="7" onclick="calculator.display.value += '7'"></td>
  25.                <td><input type="button" name="eight" value="8" onclick="calculator.display.value += '8'"></td>
  26.                <td><input type="button" name="nine" value="9" onclick="calculator.display.value += '9'"></td>
  27.                <td><input type="button" class="operator" name="times" value="x" onclick="calculator.display.value += '*'"></td>
  28.             </tr>
  29.             <tr>
  30.                <td><input type="button" id="clear" name="clear" value="c" onclick="calculator.display.value = ''"></td>
  31.                <td><input type="button" name="zero" value="0" onclick="calculator.display.value += '0'"></td>
  32.                <td><input type="button" name="doit" value="=" onclick="calculator.display.value = eval(calculator.display.value)"></td>
  33.                <td><input type="button" class="operator" name="div" value="/" onclick="calculator.display.value += '/'"></td>
  34.             </tr>
  35.          </table>
  36.       </form>
  37.    </body>
  38.    </head>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement