I want to animate something everytime I click on it. So I saved an animation in the class "animation".
function listClick() {
toplist.classList.add("animation");
toplist.classList.remove("animation");
}
the animation lasts 2000 ms so I want a delay of 2000 ms between those two lines of code in my function. How can I achieve this using Javascript?