my checkboxs each look like this:
<input id="bulk_selected_" name="bulk_selected[]" type="checkbox" value="159">
my checkboxs each look like this:
<input id="bulk_selected_" name="bulk_selected[]" type="checkbox" value="159">
Use an attribute-equals selector and .is(), like this:
return $("input[name='bulk_selected[]']").is(":checked");
//or...
return $("input[name='bulk_selected[]']:checked").length;
.is() will return true is any of the elements match the selector. Or a bit faster version:
return $("input[name='bulk_selected[]']").filter(function() {
return this.checked;
}).length > 0;
return jQuery('[name="bulk_selected[]"]:checked').size()
If none are checked, then it will return 0 (a false value) otherwise it will return a positive number (which will be true).