Lefseq,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<div class="myClass">
<span class="pusk">пуск</span>
<span class="num">25</span>
<span class="pusk">пуск</span>
<span class="num">30</span>
<span class="pusk">пуск</span>
<span class="num">50</span>
</div>
<script>
let myClass = document.querySelector('.myClass'),
num = [...myClass.querySelectorAll('.num')],
pusk = [...myClass.querySelectorAll('.pusk')];
let old = JSON.parse(localStorage.getItem('somme') || '{}');
Object.keys(old).forEach(i => {
++num[i].textContent;
pusk[i].style.color = 'red'
});
myClass.addEventListener('click', e => {
if (e.target.classList.contains('pusk')) {
let it = e.target;
let i = pusk.indexOf(it);
if (old[i]) {
--num[i].textContent;
pusk[i].style.color = '';
delete old[i]
} else {
++num[i].textContent;
pusk[i].style.color = 'red';
old[i] = true
}
localStorage.setItem('somme', JSON.stringify(old))
}
});
</script>
</body>
</html>