diff options
author | Rasmus <rasmus.luha@gmail.com> | 2023-04-01 16:15:52 +0300 |
---|---|---|
committer | Rasmus <rasmus.luha@gmail.com> | 2023-04-01 16:15:52 +0300 |
commit | ba837f70632519d58ae0f3f95bfad0dbb8051fc0 (patch) | |
tree | 3fc7d6b8715d4e7818d197d8408c791af28da608 /rannak/mangud/direktor/baltikett/script.js | |
parent | 760e8fff4d4fd71350ddc9b17e85e95a17d4ce8e (diff) |
Loosung ja Baltikett
Diffstat (limited to 'rannak/mangud/direktor/baltikett/script.js')
-rw-r--r-- | rannak/mangud/direktor/baltikett/script.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/rannak/mangud/direktor/baltikett/script.js b/rannak/mangud/direktor/baltikett/script.js new file mode 100644 index 0000000..f5d1016 --- /dev/null +++ b/rannak/mangud/direktor/baltikett/script.js @@ -0,0 +1,47 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + + +const inputs = document.querySelectorAll('input'); +let asulaVal; +let kaugusVal; +let teekondVal; + +for (input of inputs){ + input.addEventListener('input', () => { + getInputs() + }); +} + + +function getInputs(){ + let teekond = document.querySelector('.teekondInput'); + let asula = document.querySelector('.asulaInput'); + let kaugus = document.querySelector('.kaugusInput'); + + asulaVal = asula.value; + kaugusVal = kaugus.value; + teekondVal = teekond.value; + + if (asulaVal != '' && kaugusVal != '' && teekondVal != '') + allGood(); +} + + + +/// All Done /// + + + +function allGood(){ + const btn = document.querySelector(".moveOn"); + btn.disabled = false; + localStorage.setItem("roll", "Direktori"); + localStorage.setItem("asula", asulaVal); + localStorage.setItem("kaugus", kaugusVal); + localStorage.setItem("teekond", teekondVal); + btn.onclick = () => location.href = "../../../endPage"; +} |