how to play css animation with javascript

CSS
element.style.webkitAnimationPlayState = "paused";
element.style.webkitAnimationPlayState = "running";
Source

Also in CSS: