I am trying to select list id automatically using Jquery. When I click on some list it should take its id and allow toggle. Now I want that JQuery automatically gets the ID`` of clicked Item and perform the toggle.
By toggle I mean when I click on Catalog other list items will hide. And only Catalog list will show.
I want to implement below Jquery :
$('#cssmenu li:has(ul) a').on('click', function(e) {
e.preventDefault();
if( $(this).hasClass('activeSubmenu') ) {
$(this).removeClass('activeSubmenu').next('ul').hide();
}
else {
$('.activeSubmenu').removeClass('activeSubmenu').next('ul').hide();
$(this).addClass('activeSubmenu').next('ul').show();
}
});
*
<ul ng-repeat="codes in response">
<li ng-if="((codes.branch == formData.branches.alias) && (codes.taken == 0))">
<strong>{{codes.id}}</strong>
{{codes.code}}
</li>
</ul>