JavaScript:
function getValue(){
var num1 = document.getElementById(firstNum).value;
var num2 = document.getElementById(secondNum).value;
return (num1, num2);
}
function add(){
getValue();
var result = parseFloat(num1) + parseFloat(num2);
return result;
}
What I'm creating is a calculator that gets the values from input boxes. What I'm having trouble with is how am I supposed to call the variables I declare in the getValue(); function in my add(); function to create a value.
I appreciate the help.