function updateBreedingUsage() { // Get the selected monster from the dropdown var selectedMonster = document.getElementById("monsterDropdown").value; // Fetch data from the API fetch(`/api/breeding/usage/${selectedMonster}`) .then(response => response.json()) .then(data => { // Update the HTML with the list of offspring monsters renderOffspringList(data.used_in); }) .catch(error => console.error('Error fetching data:', error)); } function renderOffspringList(usageData) { var offspringContainer = document.getElementById("offspringContainer"); // Clear previous HTML content offspringContainer.innerHTML = "

Used to Breed:

"; }