The idea is that I should be able to have two fields where I input numbers, then I need to display the sum as well as the product.
I figured I would test out the product, but I keep getting a "Not a Number" error. Any help Would be great!
<!DOCTYPE html>
<html>
<body>
<form>
First Number<br>
<input id="num1" type="text" name="num1">
<br>
Second Number:<br>
<input id="num2" type="text" name="num2">
<br><br>
<input type="button" value="Do Maths" onclick="doMath();" />
</form>
<script>
function doMath() {
var numOne = document.getElementById('num1').value;
var numTwo = document.getElementById('num2').value;
var theProduct = parseInt(my_input1) * parseInt(my_input2); document.write(theProduct);
document.write(theProduct);
}
</script>
</body>
</html>
my_input1&my_input2are not declared anywhere.my_input1andmy_input2is not defined.numOneandnumTwoshould the paramsparseInt(numOne) * parseInt(numTwo)