How to mark up such drop-down menu?

Good time of day. Laid out menu, but the problem is that its opening even when I press radio button or a cross.
18d48f91066943fa9857dce608669bfd.jpg
<ul id="my-menu" class="sample-menu">
the <li>
 <a href="#0">Companies</a>
the <ul>
the <li>
 <a href="#0">Comp name</a>
the <ul>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>

</li>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>
</li>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>
</li>
</ul>
</li>
the <li>
 <a href="#0">Comp name</a>
the <ul>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>

</li>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>
</li>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>
</li>
</ul>
 </li> <li>
 <a href="#0">Comp name</a>
the <ul>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>

</li>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>
</li>
the <li>
 <a href="#0">Ivanov Ivan Ivanovich</a>
</li>
</ul>
</li>
</ul>
</li>



 </ul>

$('ul#my-menu ul').each(function(i) { // Check each submenu:
 if ($.cookie('submenuMark-' + i)) { // If index of submenu is marked in cookies:
 $(this).show().prev().removeClass('collapsed').addClass('expanded'); // Show it (add apropriate classes)
 } else {
 $(this).hide().prev().removeClass('expanded').addClass('collapsed'); // Hide it
}
 $(this).prev().addClass('collapsible').click(function() { // Attach an event listener
 var this_i = $('ul#my-menu ul').index($(this).next()); // The index of the submenu of the clicked link
 if ($(this).next().css('display') == 'none') {
 $(this).next().slideDown(200, function() { // Show submenu:
$(this).prev().removeClass('collapsed').addClass('expanded');
cookieSet(this_i);
});
 } else {
 $(this).next().slideUp(200, function() { // Hide submenu:
$(this).prev().removeClass('expanded').addClass('collapsed');
cookieDel(this_i);
 $(this).find('ul').each(function() {
 $(this).hide(0, cookieDel($('ul#my-menu ul').index($(this)))).prev().removeClass('expanded').addClass('collapsed');
});
});
}
 return false; // Prohibit the browser to follow the link address
});
});
 function cookieSet(index) {
 $.cookie('submenuMark-' + index, 'opened', {
 expires: null
 path: '/'
 }); // Set mark to cookie (submenu is shown):
}

 cookieDel function(index) {
 $.cookie('submenuMark-' + index, null, {
 expires: null
 path: '/'
 }); // Delete mark from cookie (submenu is hidden):
 }
July 9th 19 at 13:22
1 answer
July 9th 19 at 13:24
Solution
https://jsfiddle.net/uddou398/ I never tried , well here is ?
Only, the question is as subparagraphs Ratmir Alexandrov better to do ? rather than ask tough height. - dominique.Croo commented on July 9th 19 at 13:27

Find more questions by tags CSSHTMLJavaScript