animation-name: springy-text;
animation-timing-function: ease-in;
animation-iteration-count: infinite;
animation-direction: alternate-reverse;
animation-play-state: running;
animation-fill-mode: backwards;
@keyframes springy-text {
function togglePlayState(newState) {
document.getElementById("springy").style.animationPlayState=newState;
<h3 class="springy-text" id="springy">Animations!</h3>
<button onclick="togglePlayState('Paused');">Pause Animation</button>
<button onclick="togglePlayState('Running');">Continue Animation</button>