get all checkbox value jquery code example

Example 1: get value of selected checkbox jquery

$('#checkbox_id:checked').val();
//if checkbox is selected than gets its value

Example 2: jquery get all checkbox checked

$('.theClass:checkbox:checked')

Example 3: select all checkbox jquery

$('#select_all').change(function() {
  var checkboxes = $(this).closest('form').find(':checkbox');
  checkboxes.prop('checked', $(this).is(':checked'));
});

Example 4: find all checkbox inside div jquery

$('#selectChb').click(function(){ 
     $(':checkbox').prop("checked", true);
});