function initNav() {
    document.querySelectorAll("nav > ul > li > ul").forEach(function(submenu) {
        submenu.style.display = "block";
    });
    document.querySelectorAll("nav > ul > li > ul li").forEach(function(item) {
        item.style.display = "block";
    });
}

initNav();