Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Функция подсчета. Вешается на кнопку '='.
- function solve () {
- var equation = document.getElementById('out').value;
- document.getElementById('out').value = eval(equation);
- }
- // Функции ввода чисел. Вешаются на соответствующие кнопки
- function first () { document.getElementById('out').value += '1'; }
- function second (){ document.getElementById('out').value += '2'; }
- function third () { document.getElementById('out').value += '3'; }
- function fourth (){ document.getElementById('out').value += '4'; }
- function fifth () { document.getElementById('out').value += '5'; }
- function sixth () { document.getElementById('out').value += '6'; }
- function seventh(){ document.getElementById('out').value += '7'; }
- function eight () { document.getElementById('out').value += '8'; }
- function ninth () { document.getElementById('out').value += '9'; }
- // Функции ввода математических операторов. Вешаются на соответствующие кнопки
- function adding (){ document.getElementById('out').value += '+'; }
- function minus () { document.getElementById('out').value += '-'; }
- function delenie(){ document.getElementById('out').value += '/'; }
- function multply(){ document.getElementById('out').value += '*'; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement