I have seen numerous stack posts and other online articles that say to force a button state to active, just add the "active" class to it. This simply doesn't work.
I have an input element of type button:
<input type="button" id="btn25" value="$25" class="checkout-btn" onclick="donateButton(25)">
In Chrome Dev Tools when I select the button, expand the Force element state
panel, and check :active
, that does exactly what I need (displays the button as if it's being actively clicked by the mouse).
But adding a class named "active" or "ACTIVE" or "activated" (as suggested by numerous answered posts) does nothing. I've tried this both with jquery, and by just adding it to the static html. And I don't see how it could do anything, since I don't have a class in my css named "active".
There must be a way in jquery to force element state to :active
that does the same thing as when I check the :active
box in dev tools.