🤯 50% Off! 700+ courses, assessments, and books

jQuery get array of checked checkboxes ids

Sam Deering
Share

Use jQuery get array of checked checkboxes ids.

var checkedIds = Array();
$('form:input[type="checkbox"][checked]').each( function(i,v)
{
    checkedIds.push($(v).attr('id'));
});
console.log(checkedIds);