nick robinson nick robinson - 5 months ago 50
jQuery Question

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.


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


Here is the single line code that uncheck all the checked checkboxes. (This example illustrates both check and uncheck all checkboxes using jquery) Set prop of the checkbox to false

$("input:checkbox").prop('checked', false);