mercredi 17 août 2016

jquery uncheck dynamic checkbox

I am using load() to import some html into my page which includes some checkboxes. I'd like to have a refresh button which clears any checked checkboxes but I have been unable to get this working. Please let me know what else I can try. This selector does find all checkboxes which are 'checked' but none of the functions uncheck the checkbox.

$('#reset_button').on('click',function() 
    {
        $(':checkbox:checked').each(function()
        {
            //alert($(this).val())});
            $(this).prop('checked',false);
            $(this).attr('checked',false);
            $(this).val('off');
            $(this).removeAttr('checked');
        })
    }
    );

Aucun commentaire:

Enregistrer un commentaire