<li>
<input type="checkbox" id="master" />
<ul>
<li>
<input type="checkbox" />
$('input').bind('change', function() {}); // exists elsewhere, cannot change
When I click the top level input, I want to set .prop('checked', true)
for all of its children, but I want to avoid triggering the change
event for each child checkbox.
How could I set .prop('checked', true)
to an input without triggering change
?
Edit: (expanding)
$('#master').click(function() {
$(this).parent().find('input').each(function(n, in) {
$(in).prop('checked', true); // this triggers a change event that I need to stop
});
});