mercredi 22 juillet 2015

$('input[type=checkbox]:checked').each not executing second time around

I have the following code that on second execution does not get executed even though the check boxes are checked. Please help. Thanks

$('input[type=checkbox]:checked').each(function() {
    var $tr = $(this).closest('tr');
    var del_id = $tr.attr('data-id');
    console.log('STILL TO BE DELETED:  =' + del_arr);

    $.each(del_arr, function(index, value) {

        console.log('EVEN STILL TO BE DELETED:  =' + del_arr);

        if (value == del_id) {
            $tr.remove();
            console.log('Removing :' + del_id + ' And ' + value);
            return false;
        }
    });
})



$('input[type=checkbox]').each(function() {
    $(this).prop('checked', false);
    if (this.checked == true) {
        console.log('I am still checked')
    }
});




Aucun commentaire:

Enregistrer un commentaire