get all checkbox checked jquery code example

Example 1: jquery checkbox checked value

if ($('#check_id').is(":checked"))
{
  // it is checked
}

Example 2: jquery get value checkbox checked

console.log($('input[name="locationthemes"]:checked').serialize());

//or

$('input[name="locationthemes"]:checked').each(function() {
   console.log(this.value);
});

Example 3: how to get name array value checked in jquery

$("input:checkbox[name=type]:checked").each(function(){
    yourArray.push($(this).val());
});

Example 4: get value of all checked boxes jquery

var values = $('input[name=grepperRocks]:checked')
               .map(() => { return this.value }).get();

Example 5: jquery get all checkbox checked

$('.theClass:checkbox:checked')

Example 6: select all checkboxes jquery

$('input:checkbox').prop('checked', true);

Tags:

Html Example