2023-07-04 17:00:23 +02:00
|
|
|
"using strict";
|
|
|
|
|
2023-07-04 22:27:06 +02:00
|
|
|
const fruits = [ "Apple"
|
|
|
|
, "Banana"
|
|
|
|
, "Grapefruit"
|
|
|
|
, "Orange"
|
|
|
|
]
|
|
|
|
|
2023-07-04 17:00:23 +02:00
|
|
|
const genres = [ "FPP"
|
|
|
|
, "Action Adventure"
|
|
|
|
, "Lobotomy aka Idlegame"
|
|
|
|
, "Specticle Fighter"
|
|
|
|
]
|
|
|
|
|
2023-07-04 22:27:06 +02:00
|
|
|
//const menus = [ { "name": "Fruit", "items": [ "Banana", "Orange", "Pineapple", "Apple" ] }, { "name": "Genre", "items": [ "FFP", "Jiminy Cockthroat", "しひろ Cockthroat", "Spunk Gargle Weewee" ] } ];
|
|
|
|
const menus = [ { "name": "Fruit", "items": [ "Banana", "Orange", "Pineapple", "Apple" ] }, { "name": "Genre", "items": [ "FFP", "Action Adventrue", "Lobotomy aka Idlegame" ] } ];
|
|
|
|
|
|
|
|
const menuContainer = document.getElementById('menu-container');
|
|
|
|
|
|
|
|
menus.forEach( menu =>{
|
|
|
|
const dropdownMenu = document.createElement('menu');
|
|
|
|
const menuTitle = Object.assign(document.createElement('h2'), {innerHTML:menu.name});
|
|
|
|
const dropdownSelect = document.createElement('select');
|
|
|
|
|
|
|
|
dropdownMenu.id = menu.name.toLowerCase();
|
|
|
|
menuContainer.append(menuTitle)
|
|
|
|
menuContainer.appendChild(dropdownMenu)
|
|
|
|
dropdownMenu.appendChild(dropdownSelect)
|
|
|
|
|
|
|
|
menu.items.forEach(item =>{
|
|
|
|
dropdownSelect.append(Object.assign(document.createElement('option'), {id:item.toLowerCase(), innerHTML:item}))
|
|
|
|
})
|
|
|
|
})
|