JSFiddle - React, Tailwind, and code Playground

by zlojnaxa

HTML

<input type="radio" name="radio">

JavaScript

$('input').on('click', function(){     
        if($(this).attr("checked") == 'checked') {  
            $(this).removeAttr('checked');
        } else {
            $(this).attr('checked', 'checked')
        }
    });