I\'m sitting with a problem, I need to check with JQuery if no radio button within a radio button group has been checked, so that I can give the users an javascript error if
Use .length
refer to http://api.jquery.com/checked-selector/
if ($('input[name="html_elements"]:checked').length === 0) alert("Not checked");
else alert("Checked");
I think this is a simple example, how to check if a radio in a group of radios was checked.
if($('input[name=html_elements]:checked').length){
//a radio button was checked
}else{
//there was no radio button checked
}