math in javascript
//Math in JS is similar and different to the one in real life
//Like: "+", "-" signs are the same. But "X" and "÷" are replaced with "*" and "/" respectivly
//You can do math both with variables and normal numbers
________________________________________________________________________________
Normal Number Examples
4+4 = 8;
4-4 = 0;
4*4 = 16;
4/4 = 1;
________________________________________________________________________________
Variable Examples
num1 = 0;
num2 = 0;
ans = 0;
num1 = 4;
num2 = 64
num1 + num2 = 68
num1 - num2 = 60
num1 * num2 = 24
num1 / num2 = 256;
num1 + num2 = ans;
num1 - num2 = ans;
num1 * num2 = ans;
num1 / num2 = ans;
________________________________________________________________________________
Now, you can use the document.getElementByID("").innerHTML = ans; to set the answer
//I hope this post helped you!