Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main(button){
- var display = document.getElementById("demo")
- var valOfDisplay = display.innerHTML
- var buttonValue = button.value
- if (buttonValue == ' = '){
- var equation = valOfDisplay;
- if(equation)
- display.innerHTML = eval(equation);
- } else {
- display.innerHTML += buttonValue;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement