JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" value=" Never " name="btnsubmit" id="answer" style="width: 200px;" />
CSS
.red-background {
background-color: red;
}
JavaScript
$('input[id="answer"]').click(function () {
$(this).toggleClass('red-background');
});