JSFiddle - React, Tailwind, and code Playground

HTML

<fieldset>
        <legend>Pregunta 1</legend>
        <input type="radio" name="q1" id="1"/><label for="1">respuesta 1</label>
        <input type="radio" name="q1" id="2"/><label for="2">respuesta 2</label>
        <input type="radio" name="q1" id="3"/><label for="3">respuesta 3</label>
        <input type="radio" name="q1" id="4"/><label for="4">respuesta 4</label>
    </fieldset>
    <div id="here"></div>
    <button id="respuesta">Respuesta</button>

JavaScript

$(document).ready(function(){
        $('#respuesta').click(function() {
                if($("input[type='radio']:checked").attr("id") == '4'){
                    $(this).css("background-color", "green");
                    $("#here").text("respuesta Correcta.")
                }else{
                    $(this).css("background-color", "red");
                    $("#here").text("respuesta Incorrecta.")
                }
        });
    });