check value of multiple check boxes

check value of multiple check boxes

I am using the following code to check the value of multiple check boxes

if ($('#ForenameUnknown').is(':checked') || $('#SurnameUnknown').is(':checked'))
{
      // my code
}

this runs my code if at least one of them is true

i want to replace this code with something that checks the value of all checkboxes on the form in a single statement
something like this


if ($('form > input[type=checkbox]').is(':checked')){
      //my code
}

(I would want this to run run my code if at least one is checked or if all are not checked, )

I want to be able to do this or something like it so i can add more checkboxes later and not have to update the if statement, and so that the inital code looks cleaner)

Is this possible.