JSFiddle - React, Tailwind, and code Playground
HTML
<input type="radio" id="radio1" name="test"/>
<input type="radio" id="radio2" name="test"/>
<input type="button" onclick="testcheck()" value="Test"/>
JavaScript
function testcheck()
{
if($("input[name='test']:checked").length > 0){
alert($("input[name='test']:checked").attr("id") + " checked");
}else{
alert("none checked");
}
}