Ok, So I have a list of checkboxes in a pop up. I grab two lists of jquery dom elements, a list of the checkboxes and a list of the checkboxes that are checked. The idea is that the user can change the checkboxes then if they want to, press a cancel button and it will revert to the original.
I get the two lists...
var allDropDownCheckboxes = $(this).next().find(".dropDownCheckbox");
var selectedCheckboxes = $(this).next().find(".dropDownCheckbox:checked");
On the cancel button being pressed I revert the checkboxes to their original state...
allDropDownCheckboxes.attr('checked', false);
selectedCheckboxes.attr('checked', true);
It unchecks them all but doesn't check the ones that were originally checked again...
Why?!
Thanks