From 760e8fff4d4fd71350ddc9b17e85e95a17d4ce8e Mon Sep 17 00:00:00 2001 From: Rasmus Date: Fri, 31 Mar 2023 19:41:34 +0300 Subject: oops --- .../mangud/kaitseliitlane/soomusmasinad/script.js | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 rannak/mangud/kaitseliitlane/soomusmasinad/script.js (limited to 'rannak/mangud/kaitseliitlane/soomusmasinad/script.js') diff --git a/rannak/mangud/kaitseliitlane/soomusmasinad/script.js b/rannak/mangud/kaitseliitlane/soomusmasinad/script.js new file mode 100644 index 0000000..ca18bfe --- /dev/null +++ b/rannak/mangud/kaitseliitlane/soomusmasinad/script.js @@ -0,0 +1,43 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + + +const inputs = document.querySelectorAll('input'); +let asulaVal; +let kaugusVal; + +for (input of inputs){ + input.addEventListener('input', () => { + getInputs() + }); +} + + +function getInputs(){ + let asula = document.querySelector('.asulaInput'); + let kaugus = document.querySelector('.kaugusInput'); + + asulaVal = asula.value; + kaugusVal = kaugus.value; + + if (asulaVal != '' && kaugusVal != '') + allGood(); +} + + + +/// All Done /// + + + +function allGood(){ + const btn = document.querySelector(".moveOn"); + btn.disabled = false; + localStorage.setItem("roll", "Kaitseliitlase"); + localStorage.setItem("asula", asulaVal); + localStorage.setItem("kaugus", kaugusVal); + btn.onclick = () => location.href = "../../../endPage"; +} -- cgit v1.2.3