I am trying to place a number from a local TXT file in the "let count = 0" instruction, so "let count = number.txt"
That way the counter will read the number placed on the txt file and perform the addition/subtraction operation.
Thank you!
<!DOCTYPE html>
<html>
<body>
<h1 class="counter-wolf-numbers">(..)</h1>
<button class="counter-wolf-minus">-</button>
<button class="counter-wolf-plus">+</button>
<script>
let counterDisplayElem = document.querySelector('.counter-wolf-numbers');
let counterMinusElem = document.querySelector('.counter-wolf-minus');
let counterPlusElem = document.querySelector('.counter-wolf-plus');
let count = 0;
updateDisplay();
counterPlusElem.addEventListener("click",()=>{
count++;
updateDisplay();
}) ;
counterMinusElem.addEventListener("click",()=>{
count--;
updateDisplay();
});
function updateDisplay(){
counterDisplayElem.innerHTML = count;
};
</script>
</body>
</html>