var textWrapper = document.querySelector('.theselector'); textWrapper.innerHTML = textWrapper.textContent.replace(/\S/g, "$&"); anime.timeline({loop: loopvalue}) .add({ targets: '.theselector .letter', translateY: [-100,0], easing: "easeOutExpo", duration: 1400, delay: (el, i) => 30 * i });