在下面的示例中,我希望选择“radios”列表的所有“:checked”单选按钮。如何?
var radios = someDiv.find("input[type=radio]");
if (radios.length > 0)
{
// I wish to find all the checked radio buttons in the
// "radios" list - this doesn't work:
var checkedRadios = radios.find(":checked");
if (checkedRadios.length == 0)
alert("You have to select an option stoopid");
}