You can do it like this ...
var Ids = $('.head:has(:checkbox:checked)')
.map(function() { return this.id })
.get();
If you want it to run faster using jQuery's internal use querySelectorAll(), you can use ...
var Ids = $('.head').filter(function() {
return $(this).has('input[type="checkbox"]') && this.checked;
});
..., jQuery .head, .