I am dynamically checking chekboxes by using below function.
$('input[type="checkbox"]').each(function() {
$(this).attr('checked', true);
});
I want to store whole checked checkboxes in string.
I am dynamically checking chekboxes by using below function.
$('input[type="checkbox"]').each(function() {
$(this).attr('checked', true);
});
I want to store whole checked checkboxes in string.
var ids =''
$('input[type="checkbox"]').each(function() {
if($(this).attr('checked')=='checked'){
ids += $(this).attr(id) + ',';
}
});
You may also then split ids by comma and acquire an array of IDs
var ids = ids.split(',')