Skip to content

Instantly share code, notes, and snippets.

@Heyitsthatonekid
Created September 21, 2014 00:50
Show Gist options
  • Save Heyitsthatonekid/6c3c6c26c311332e0ffb to your computer and use it in GitHub Desktop.
Save Heyitsthatonekid/6c3c6c26c311332e0ffb to your computer and use it in GitHub Desktop.
Calculator
<html><head></head><body><form name="Calc">
<table border="8">
<tbody><tr>
<td>
<input type="text" name="Input" size="20">
<br>
</td>
</tr>
<tr>
<td>
<input type="button" name="one" value=" 1 " onclick="Calc.Input.value += '1'">
<input type="button" name="two" value=" 2 " onclick="Calc.Input.value += '2'">
<input type="button" name="three" value=" 3 " onclick="Calc.Input.value += '3'">
<input type="button" name="plus" value=" + " onclick="Calc.Input.value += ' + '">
<br>
<input type="button" name="four" value=" 4 " onclick="Calc.Input.value += '4'">
<input type="button" name="five" value=" 5 " onclick="Calc.Input.value += '5'">
<input type="button" name="six" value=" 6 " onclick="Calc.Input.value += '6'">
<input type="button" name="minus" value=" - " onclick="Calc.Input.value += ' - '">
<br>
<input type="button" name="seven" value=" 7 " onclick="Calc.Input.value += '7'">
<input type="button" name="eight" value=" 8 " onclick="Calc.Input.value += '8'">
<input type="button" name="nine" value=" 9 " onclick="Calc.Input.value += '9'">
<input type="button" name="times" value=" X " onclick="Calc.Input.value += ' * '">
<br>
<input type="button" name="clear" value=" C " onclick="Calc.Input.value = ''">
<input type="button" name="zero" value=" 0 " onclick="Calc.Input.value += '0'">
<input type="button" name="DoIt" value=" = " onclick="Calc.Input.value = eval(Calc.Input.value)">
<input type="button" name="div" value=" ÷ " onclick="Calc.Input.value += ' / '">
<br>
</td>
</tr>
</tbody></table>
</form>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment