Find Cousin 2x Removed Class Toggle

language: Javascript
license: Other

Code for Snippet:

                
$('.ToggleClass').click(
	function(e) {
		var target = $(this).attr('href or data-target');
        	var auntie = $(this).parent('parentElement').siblings();
        	$(target).siblings('.active').removeClass('active');
        	$(target).toggleClass('active');
        	$(auntie).find('childElement grandchildElement').toggleClass('classA classB');
});
comments powered by Disqus

Info

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 274
Date Added: 2015-07-16 17:51:42
Last Modified: 2015-07-16 11:51:52

Web Analytics