I have a menu with three levels of nesting. I open each one in turn with the following code:
$(".menu-item-has-children").click(function (event) {
event.preventDefault();
$(this).children(".sub-menu").slideToggle();
});
The first level of nesting opens well. And when I try to open the next level, the previous one closes. And when I open it again, the next one is open. How can I fix this and make it possible to open and close the menu one by one?