15 lines
558 B
JavaScript
15 lines
558 B
JavaScript
|
document.addEventListener("DOMContentLoaded", function () {
|
||
|
fetch('./scripts/items.json')
|
||
|
.then(Response => Response.json())
|
||
|
.then(data => {
|
||
|
const itemDisplay = document.getElementById("iType");
|
||
|
|
||
|
//creates HTML elements to display JSON data
|
||
|
const typeElement = document.createElement("option");
|
||
|
typeElement.textContent = items.itemTypes;
|
||
|
|
||
|
//append the elements to the options
|
||
|
itemDisplay.appendChile(itemDisplay);
|
||
|
})
|
||
|
.catch(error => console.error("Error fetching JSON Data:", error));
|
||
|
});
|