Getting Checked Elements Value

Getting Checked Elements Value

What is the best way to get all elements that are checked by selecting a classname? I have the following code, but is this the best/most efficient way of doing this?

function get_checked_values(p_ClassName) {
   var checked = new Array();
   
   p_className.is(":checked").each(function() {
      checked.push(this.val());
   });
   
   return checked;
}


Usage:

get_checked_values($("checkboxes_class"));