See fiddle
Why? I'm trying to get them to stay in sync (I.e. if any of the sub-checkboxes are checked, the parent should be checked, and vice-versa. Clicking the unchecked parent should check the top child, otherwise if it's already checked, it should uncheck all children). It appears that checktop.checked
doesn't accurately reflect the UI.
Edit: Tested in FF7, Chrome 16, IE9.
updated fiddle -- This alerts "i'm checked" (if you follow the instructions) when I'd expect it to say "i'm not checked" because you've just unchecked it, and the change event should fire afterwords.
Replace all occurences of "attr()" with "prop()" http://jsfiddle.net/Cqt5Q/8/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With