JSFiddle - React, Tailwind, and code Playground
HTML
<div class='radio'>1)
<input type="radio" id="radio1" name="radio1" value="1" /><label for="radio1">Choice 1</label>
<input type="radio" id="radio2" name="radio1" value="2" /><label for="radio2">Choice 2</label>
<input type="radio" id="radio3" name="radio1" value="3" /><label for="radio3">Choice 3</label>
</div>
<div class='radio'>2)
<input type="radio" id="radio1" name="radio2" value="1" /><label for="radio1">Choice 1</label>
<input type="radio" id="radio2" name="radio2" value="2" /><label for="radio2">Choice 2</label>
<input type="radio" id="radio3" name="radio2" value="3" /><label for="radio3">Choice 3</label>
</div>
<div class='radio'>3)
<input type="radio" id="radio1" name="radio3" value="1" /><label for="radio1">Choice 1</label>
<input type="radio" id="radio2" name="radio3" value="2" /><label for="radio2">Choice 2</label>
<input type="radio" id="radio3" name="radio3" value="3" /><label for="radio3">Choice 3</label>
</div>
JavaScript
$('input').on('click', function() {
check_all();
});
function check_all() {
var outputText = 'These are not checked: ';
var myDivs = $('div.radio');
for (var i=0; i<myDivs.length; i++) {
var isChecked = false;
var childInputs = myDivs[i].getElementsByTagName('input');
for (var j=0; j<childInputs.length; j++) {
if (childInputs[j].checked == true) {
isChecked = true;
}
}
if (isChecked == false) {
outputText += (i+1) +', ';
}
}
alert(outputText.slice(0, -2));
}