Shadowrun6eUltimaniaSys/scripts/itemDisplay.js

15 lines
558 B
JavaScript
Raw Permalink Normal View History

2024-06-28 09:37:25 +00:00
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));
});