There is a problem:
<ul> <li> <ul> <li></li> </ul> </li> ....same blocks </ul> When I click on the external li it gets the class "active". I press again - the class disappears. But when I press on the internal li, the class "active" still goes away. Help, how to make them react to clicks independently of each other?
Js
$('.nav-cats li').click(function(){ if($(this).hasClass("active")) $(this).removeClass("active"); else $(this).addClass("active"); }); HTML
<ul class="nav-cats"> <a href="#"><li> Home<br/><span class="quant-of-cats">(652547)</span> <ul> <a href="#"> <li>Subcat</li> </a> </ul> </li></a> </ul>