I am struggling to make the two numbers i put in the text field multiply and show me the answer to the multiplication. Here is how it should look like when i click the multiply numbers button:(https://i.stack.imgur.com/WXEkm.png)](https://i.stack.imgur.com/WXEkm.png)
So i have tried what is shown here:
<script>
var userInput1 = document.getElementById("user-input-1");
var userInput2 = document.getElementById("user-input-2");
var numbersBtn = document.getElementById("numbers-btn");
var outputDiv = document.getElementById("output-div");
numbersBtn.onclick = getMultiplication;
var number1 = userInput1.value;
var number2 = userInput2.value;
function getMultiplication(number1, number2) {
var result = number1 * number2;
return result;
}
outputDiv.innerHTML = getMultiplication(number1, number2);
</script>
It looks like this on the webpage:(https://i.stack.imgur.com/HxMCT.png)](https://i.stack.imgur.com/HxMCT.png)
The when i type numbers in the boxes and click the button, nothing happens and no error in the console log.
I have also tried without .value behind the userInputs, but then it displays NaN. I have also tried som other orders of the code, still no luck.
(Im very new to JS and parameters is one of my biggest weaknesses).