How can I check if an animation on a div is currently playing in plain js?

I want to be able to check in an if statement if an animation on a selected div is in progress by returning a boolean or something equivalent. Something like this.

let div_with_anim = document.getElementById("div_with_anim");

if (div_with_anim.animationInProgress()) {}

or if I can make a function that has the same effect.