-
-
Save thams017/11c5786da46b90843bf8 to your computer and use it in GitHub Desktop.
Calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function one () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '1'; | |
} | |
function two () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '2'; | |
} | |
function three () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '3'; | |
} | |
function four () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '4'; | |
} | |
function five () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '5'; | |
} | |
function six () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '6'; | |
} | |
function seven () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '7'; | |
} | |
function eight () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '8'; | |
} | |
function nine () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '9'; | |
} | |
function zero () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '0'; | |
} | |
function reset () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value = ""; | |
} | |
function add () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '+'; | |
} | |
function sub () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '-'; | |
} | |
function mul () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '*'; | |
} | |
function div () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '/'; | |
} | |
function dot () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '.'; | |
} | |
function openBrace () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += '('; | |
} | |
function closeBrace () | |
{ | |
var res = document.getElementById( "text" ); | |
res.value += ')'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment