This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Child terms unticked by default

#38479
theapetheape
Participant

I’m so close, I don’t know if you can help nudge it over the line.

	jQuery(function($){
		$('*[data-lvl]').removeAttr('data-lvl');
		$(".asp_option_cat_level-1").hide();
		$(".asp_option_cat_level-2").hide();
		$(".asp_option_cat_level-0").click(function(){
			$(this).siblings('.asp_option_cat_level-1').toggle();
			$(this).siblings('.asp_option_cat_level-2').hide();
		});
		$(".asp_option_cat_level-1").click(function(){
			$(this).siblings('.asp_option_cat_level-2').toggle();
		});  
	});

How do I get this hide/show only the children of the checked parent rather than all of the children when a parent is clicked? I also need to figure out how to have the children automatically unchecked when a parent is unchecked.