How to get values list of checked checkboxes

[javascript] function getCheckedId_s()
{
var allVals = [];
$("input[type='checkbox']:checked").each(function() {
allVals.push( $(this).val() );
});
if( ! allVals ) return false;
len = allVals.length;
if( len == 0) return false;
return allVals;
} [/javascript]