Skip to content

Instantly share code, notes, and snippets.

@georgestephanis
Created October 7, 2013 14:51
Show Gist options
  • Save georgestephanis/6869291 to your computer and use it in GitHub Desktop.
Save georgestephanis/6869291 to your computer and use it in GitHub Desktop.
jQuery(document).on( 'ready', function($){
$('.categorychecklist').on( 'click', 'input[type="checkbox"]', function(){
if ( ! $(this).is( ':checked' ) ) return;
$(this).closest( 'ul.children' )
.parentsUntil( '.categorychecklist', 'li' )
.children( 'label' )
.children( 'input[type="checkbox"]' )
.prop( 'checked', true );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment