// Function to filter biomes based on user input function filterBiomes() { let input = document.getElementById("searchBiomes"); let filter = input.value.toUpperCase(); let biomeContainer = document.querySelector(".biome-container"); let biomeItems = biomeContainer.getElementsByClassName("biome-item"); // Loop through all biome items and hide those that don't match the search for (let i = 0; i < biomeItems.length; i++) { let title = biomeItems[i].getElementsByTagName("h3")[0]; if (title) { let textValue = title.textContent || title.innerText; if (textValue.toUpperCase().indexOf(filter) > -1) { biomeItems[i].style.display = ""; } else { biomeItems[i].style.display = "none"; } } } }