JavaScript
Article
By Sam Deering

jQuery get array of checked checkboxes ids

By Sam Deering

Use jQuery get array of checked checkboxes ids.

--ADVERTISEMENT--

var checkedIds = Array();
$('form:input[type="checkbox"][checked]').each( function(i,v)
{
    checkedIds.push($(v).attr('id'));
});
console.log(checkedIds);
Recommended
Sponsors
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account