Here is piece of HTML and script file there is 3 buttons, each should increase counter on 1,2,3. But this doesn’t work. Plain JS.
const scoreEl = document.querySelectorAll('.score-title');
let count = 0;
function increment() {
count = count + 1;
scoreEl.textContent = count;
}
function twoIncrement() {
count += 2;
scoreEl.textContent = count;
}
function threeIncrement() {
count += 3;
scoreEl.textContent = count;
}
<div class="score">
<div class="score-title">0</div>
</div>
<div class="button-container">
<button onclick="increment()" class="btn-score">+1</button>
<button onclick="twoIncrement()" class="btn-score">+2</button>
<button onclick="threeIncrement()" class="btn-score">+3</button>
</div>
</div>