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