[JS & CSS] can you trigger the :active CSS of a DOM?

Hello fellow camper. I’m currently working on the react drum machine project and everything is going fine so far, apart from something :

Is it possible to actually trigger the a button via an event listener so that the button’s css becomes :active as if it was clicked on ?

I know it is possible to trigger the function held by the onClick prop of the button using DOM.click() but so far it’s only triggering the function and making the outline of the button visible.

I hope i’m being clear on what i’m asking. Thanks for reading and have a good evening !

It’s what I ended up doing, but since I failed to triger the :active pseudo element, I figured I’d ask since I didn’t know if it was actually possible or not.