I have a treelist containing several levels of checkboxes , and I'm trying to get the parent checkbox to display as 'checked' when I click any of the child checkboxes . For some reason this doesn't work and it kills me.
JAVASCRIPT
$(function() { $("input.boundChild[type=checkbox]").click(function() { $(this).closest("input.boundParent").prop("checked", "checked"); }); });
HTML
<ul> <li class="collapsed expanded"> <input id="0" class="boundParent" type="checkbox" > Australia <ul style="display: block;"> <li> <input id="0/" class="boundChild" type="checkbox" checked=""> <input type="hidden" value="Intel Australia PTY Ltd."> </li> </ul> </li> </ul>
source share