lundi 4 mai 2015

javascript array of checkboxes

I have to iterate an array of checkboxes asking if the checkbox is checked but I couldn't get the results. Here is my code

var checkboxes = $(".checked"); 
for (var i = 0; i < checkboxes.length; i++) {
    var check = checkboxes[i];
    if(check.prop('checked')){
        console.log("Checkbox number: " + i + " is checked");
    }
} 




Aucun commentaire:

Enregistrer un commentaire