window.onload = function() {
const menuFull = document.getElementsByClassName("menu__categories");
console.log(menuFull);
console.log(menuFull[0]);
}
function loadScript() {
return new Promise(function(resolve) {
let script = document.querySelector('#menu-script');
script.onload = () => resolve(script);
});
}
let promise = loadScript();
promise.then( () => {
const menuFull = document.querySelector('#menu-full');
console.log(menuFull);
for (let elem of menuFull.children) {
console.log(elem)
}
});