I wrote a script but it does not work, I would appreciate it if you counter-elem__plus where you made a mistake, when you click counter-elem__plus number increases by 1 and when counter-elem__minus drop 1
var splashVal = document.querySelector(".splash-input").value; var count = 0; document.querySelector(".counter-elem__plus").onclick = function() { count += parseFloat(splashVal + 1); splashVal = count; } document.querySelector(".counter-elem__minus").onclick = function() { if (count > 1) { count += parseFloat(splashVal - 1); splashVal = count; } } <input type="text" class="counter-elem__input splash-input" value="5"> <div class="counter-elem__arrow counter-elem__plus"></div> <div class="counter-elem__arrow counter-elem__minus"></div>