summaryrefslogtreecommitdiff
path: root/rannak/mangud/kaitseliitlane/soomusmasinad/script.js
blob: ca18bfede598644610e483d1047711c3137f2c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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";
}