Assisting you with your financial and tax needs for 65
window.onload = function() {
var spans = document.querySelectorAll(‘span[id^=”years-since-“]’);
spans.forEach(function(span) {
var id = span.id.split(‘-‘).pop(); // Extracting the year from the ID
if (!isNaN(id) && id.length === 4) { // Checking if it’s a valid 4-digit number
var yearDifference = new Date().getFullYear() – parseInt(id);
span.textContent = yearDifference;
}
});
}
years!