Something like this should do the trick
if ($("input[type=radio]:checked").length > 0) {
// Do your stuff here
}
UPDATE
Did not see that it's not supposed to have jQuery, so here's an alternative function to check that in pure JS
function check(){
var radios = document.getElementsByName("choice");
for (var i = 0, len = radios.length; i < len; i++) {
if (radios[i].checked) {
return true;
}
}
return false;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…