I have a header checkbox and subsequent "children" checkboxes that are displayed programmatically each time my app loads.
I'm trying to ensure that if the user unchecks all the children boxes, it auto unchecks the header. I map through all checkboxes on the page at the start:
var x = '';
$(document).ready(function() {
$('.class').map(function () {
x += ('Yes');
});
alert(x);
});
This gives me an array with "Yes" for the number of checkboxes that exist in each section.
I need to be able to slice the array into nothing as the user unchecks boxes within that class. I'm stuck.
Aucun commentaire:
Enregistrer un commentaire