JSFiddle - React, Tailwind, and code Playground

HTML

<button>TEST</button>
<br>
<br>
<a href='#'>Change button's :active background-color to yellow</a>

CSS

button {
    background-color: blue;
    color: white;
    font-size: 200%;
}
button:active {
    background-color: red;
}
button.active-style:active {
    background-color: yellow;
}

JavaScript

$('a').click(function (e) {
    e.preventDefault();

    $('button').addClass('active-style');
});