add active menu but not shown in menu
CSS============================= .hs-menu-wrapper ul li.hs-item-has-children.hide-child > .child-trigger { display: none !important; } .hs-menu-wrapper ul li.hs-item-has-children.hide-child > ul { display: none !important; } .hs-menu-wrapper ul li.hs-item-has-children.hide-child > a:after{ display: none !important; } .hide { display: none !important; } JS============================= $('.hs-menu-wrapper ul li a').each(function(){ $(this).parent().addClass( $(this).text().split(" ").join('-').toLowerCase() ); }); $('.hs-menu-wrapper ul li.hs-item-has-children').each(function(){ var childLength = $(this).children('ul').children('li').length; var childHideLength = $(this).children('ul').children('li.hide').length; if( childLength == childHideLength ){ $(this).addClass('hide-child'); } });