Итак, я попробовал ответ по всему Интернету и не смог найти правильный ответ.
Мой код:
HTML
<th scope="col">
<button class="button" type="button" id="subButton"
onclick="subStrength();" value="subtract">-</button>
</th>
<th>
<span id="strength"></span>
</th>
JS:
function subStrength(){
strength = strength - 1;
document.getElementById("strength").innerHTML = strength;
}
function addStrength(){
strength = strength + 1;
document.getElementById("strength").innerHTML = strength;
}