I have multiple groups of checkboxes and radios.
Each group has a unique name attribute but I do not know these names.
I’m looking for a selector to get each group and then loop through them to make sure at least one item is checked.
Obviously I can do an each and compare the names, create an array of unique ones and then loop through the array but I’d rather do it all in one each to be more proficient. Suggestions?
You can loop through the elements and store the count for each group as properties in an object. Example:
Demo: http://jsfiddle.net/d4mTs/