Spaces:
Running
Running
Download script.js from Presidor1/STC_NEW_APP: direct link, hf CLI and curl.
- Browser
- Download file 815 Bytes
-
https://huggingface.co/spaces/Presidor1/STC_NEW_APP/resolve/main/script.js
- Command line
-
hf download hf://spaces/Presidor1/STC_NEW_APP/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Presidor1/STC_NEW_APP/resolve/main/script.js
815 Bytes
| document.addEventListener("DOMContentLoaded", () => { | |
| const stateSelect = document.getElementById("state"); | |
| const lgaSelect = document.getElementById("lga"); | |
| const lgas = { | |
| Adamawa: ["Yola", "Shelleng", "Mubi"], | |
| Borno: ["Maiduguri", "Biu", "Jere"], | |
| Kano: ["Fagge", "Dala", "Nassarawa"] | |
| }; | |
| stateSelect.addEventListener("change", () => { | |
| const selectedState = stateSelect.value; | |
| lgaSelect.innerHTML = '<option value="">Select LGA</option>'; | |
| if (lgas[selectedState]) { | |
| lgas[selectedState].forEach(lga => { | |
| const option = document.createElement("option"); | |
| option.value = lga; | |
| option.textContent = lga; | |
| lgaSelect.appendChild(option); | |
| }); | |
| } | |
| }); | |
| }); | |