JSFiddle - React, Tailwind, and code Playground

HTML

<input type=radio checked />
<input type=radio  />
<input type=radio checked />
<button>check</button>

JavaScript

$('button').click(function(){
    var counter = 1;
$('input[type=radio]').each(function(){
    if($(this).is(':checked')){
        alert(' button '+(counter)+' is checked');
    }
    counter++;
});
});