When I tried putting in values any value that is an integer it will just print out [object HTMLinputElement] x 1 = NaN. I have also tried changing the .innerHTML to .innerText and .value but it still result in the same thing. This result in the multiplication operation not executing.
function calculate() {
for (var i = 1; i <= 12; i++) {
document.getElementById('output').innerHTML += (tbInteger + " x " + i + " = " + tbInteger * i + '<br>')
}
}
<h1>Math Drills</h1>
<!-- Math Operator Input -->
Select an arithmetic operation (* or +):
<input type="text" id="tbOperator" value="*">
<br> <br>
<!-- Integer Input -->
Enter a positive integer value between 1 and 100:
<input type="number" id="tbInteger">
<br> <br>
<!-- Buttons -->
<input type="button" value="Calculate" class="button" onclick="calculate();" />
<input type="button" value="Clear" class="button" onclick="" />
<!-- Output -->
<div id="output"></div>