var tspanElement = document.querySelector('tspan'); var trophiesElement = document.querySelector('.frontpageMedals .graphicMedals'); var currentValue = 104; var trophyCount = 0; var intervalId = setInterval(function() { if (tspanElement) { tspanElement.textContent = currentValue; } currentValue++; if (currentValue % 50 === 0) { var newTrophy = document.createElement('span'); newTrophy.className = 'trophy'; trophiesElement.appendChild(newTrophy); trophyCount++; } if (currentValue > 69420) { clearInterval(intervalId); } }, 10);