The animation-fill-mode property defines what values are applied by the animation outside the time it is executing.
object.style.animationFillMode = "value";
<'animation-fill-mode'> = <single-animation-fill-mode>#
<single-animation-fill-mode> = none | forwards | backwards | both
The animation has no effect when it is applied but not executing.
After the animation ends, the animation will apply the property values for the time the animation ended.
During the period defined by animation-delay, the animation will apply the property values defined in the keyframe that will start the first iteration of the animation.
The effects of both forwards and backwards fill apply.
World Wide Web Consortium (W3C)