JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<input name="test2" type="radio" class="no-wrapper" id="1" value="Yes">Option 4
<input name="test2" type="radio" class="no-wrapper"id="2" value="Non">Option 5
<input name="test2" type="radio" class="no-wrapper" id="3" value="NA">Option 6
JavaScript
// Toggle radio buttons by clicking on the label or radio itself
// Toggle radios by only clicking the radio itself
$('input[type=radio].no-wrapper').on('mousedown', function(e){
var wasChecked = $(this).prop('checked');
this.turnOff = wasChecked;
$(this).prop('checked', !wasChecked);
var btn1=document.getElementById("1").checked;
var btn2=document.getElementById("2").checked;
var btn3=document.getElementById("3").checked;
alert( $(this).attr('value'));
if(!btn1 && !btn2 && !btn3){
$(this).prop('value',null);
alert( $(this).attr('value'));
}
});
$('input[type=radio].no-wrapper').on('click', function(e){
$(this).prop('checked', !this.turnOff);
this['turning-off'] = !this.turnOff;
});