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');
})
}
);
Conclusion note, I had to remove a class from the parent element which was styling the checkbox. the functions provided below were updating the status of the checkbox to 'unchecked' but item was not being redrawn due to styling
$(':checkbox:checked').each(function(i,v) { //alert($(this).val())}); $(v).prop('checked', false); })