Берутся все элементы, не могу выбрать конкретный элемент меню и по клику сделать, чтобы открылось только ЕГО подменю....
<div class="leftbar-menu__category">
<ul class="category__list">
<li class="category__item">Top Sales
<ul class="category__inner-list inner-list__hidden">
<li class="category__inner-item">Features</li>
<li class="category__inner-item">Morolas</li>
<li class="category__inner-item">Lacoste</li>
<li class="category__inner-item">Pernuly</li>
</ul>
</li>
<li class="category__item">Brand Focus
<ul class="category__inner-list inner-list__hidden">
<li class="category__inner-item">Features</li>
<li class="category__inner-item">Morolas</li>
<li class="category__inner-item">Lacoste</li>
<li class="category__inner-item">Pernuly</li>
</ul>
</li>
<li class="category__item">Hi-Tech
<ul class="category__inner-list inner-list__hidden">
<li class="category__inner-item">>Features</li>
<li class="category__inner-item">Morolas</li>
<li class="category__inner-item">Lacoste</li>
<li class="category__inner-item">Pernuly</li>
</ul>
</li>
<li class="category__item">Home
<ul class="category__inner-list inner-list__hidden">
<li class="category__inner-item">Features</li>
<li class="category__inner-item">Morolas</li>
<li class="category__inner-item">Lacoste</li>
<li class="category__inner-item">Pernuly</li>
</ul>
</li>
<li class="category__item">Sale
<ul class="category__inner-list inner-list__hidden">
<li class="category__inner-item">Features</li>
<li class="category__inner-item">Morolas</li>
<li class="category__inner-item">Lacoste</li>
<li class="category__inner-item">Pernuly</li>
</ul>
</li>
</ul>
const categoryList = document.querySelectorAll('.category__item');
const categoryHiddenMnuS = document.querySelectorAll('.category__inner-list');
const categoryItem = Array.prototype.slice.call(categoryList);
const categoryHiddenMnu = Array.prototype.slice.call(categoryHiddenMnuS);
categoryItem.forEach(function(list) {
list.addEventListener('click', () => {
categoryHiddenMnu.forEach( (elem) => {
elem.classList.toggle('inner-list__hidden')
})
})
})