JSFiddle - React, Tailwind, and code Playground
HTML
<button id="approve">Approve</button>
<button id="reject">Reject</button>
CSS
button.selected {
color:#fff;
}
#approve.selected {
background-color:#24ce3a;
}
#reject.selected {
background-color:#e32e10;
}
JavaScript
$(document).on('click', 'button', function () {
if ($(".selected").length === 0 | $(this).hasClass("selected")) {
$(this).toggleClass("selected");
}
});