🤯 New: Coding Assessments Practice your skills on real-world programming challenges

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);