First of all note that you are retrieving the inner html, this is a string, in this case is =0 but also could be
“hello world”
or
<li>list item</li>
if you want to parse it as a number you can initialize a number variable
let number = 0
and then when you retrieve the content can use equal to set the variable value and increase the value. So when increase its value just put that variable in the innerhtml
number = numberEl.innerHTML if dont work use parseINT
increaseButton.addEventListener('click', function (){
number = number +2 //or number += 2
numberEl.innerHTML = number
}
edit: I wrote this whitout check if works maybe its some error
When you have string and number added, it will be conversed to string by default.
You need to avoid it
let a = 0
let b = "1"
console.log(a + b)//01
console.log(typeof(a + b))//string
console.log(a + Number(b));//1
console.log(typeof(a + Number(b)))//number
Remember that ++ can only work on numbers so it will try to convert it to a number. The + operator can work with numbers for addition or strings for concatenation. It is concatenating in this case, so it evaluates to a string.
The document is a text document. There is no such thing as a written number only a string (symbolic) representation of a number. You do not write numbers but you do work on them as numbers. If what you get back from the document is a string it needs to be converted into a number before you can do any math on it. Or as suggested you can keep track of the value and work on it in JS as a number and then write it to the DOM (where it will be a string).