I tried
HTML:
<br> <span id="myspan">0</span>
Javascript:
button.addEventListener("click"), function() { document.getElementById("myspan").textContent=("+-1"); };
but it didn't seem to be working and nothing seemed to cover this. I was trying to make a click counter for fun and the button click listener, I don't know if it worked.
Javascript:
button.addEventListener("click"), function() { document.getElementById("myspan").textContent=("+-1"); };
Your
addEventListenerisn't correct.button.addEventListener("click"), function() {should actually bebutton.addEventListener("click", function() {})since the function needs to be within the parentheses.`https://codepen.io/dirtyd77/pen/KKErYRy