I want to create a script where my HTML-div is being animated everytime a key is pressed. Here is my code:

```
let square = document.querySelector("div")

document.addEventListener("keydown", function(e) {
    square.style.animation = "shake 0.5s"
    square.style.animationIterationCount = "infinite"   
})

```

My problem is, if I exclude the last line where I set `animation-iteration-count` to `"infinite"`, it works once, and if I press the button again, it won't work anymore. But if I set it to "infinite", the animation won't stop. How can I set it so that I see the animation every time I press a button, but without having the animation all the time? Thanks for any suggestion!