I would like to add the function to close the menu if I click outside the menu.
And also keep the menu button working to close it too: https://jsfiddle.net/ezkay/1he5bhzt/
$(document).ready(function () {
$("li").click(function () {
$('li > ul').not($(this).children("ul").toggle()).hide();
});
});
Also can you tell me if this is correct for mobile etc? I hope and think so, because it's using .click, right?
This is referring to this post, that I can't reply to the answer to ask there: How to change drop-down menu to drop-up menu