Skip to content

Instantly share code, notes, and snippets.

View papazetis's full-sized avatar

Nick Papazetis papazetis

View GitHub Profile
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 );
});