summaryrefslogtreecommitdiff
path: root/rannak/mangud/kaitseliitlane/soomusmasinad/script.js
blob: 4299812692388e4ee8b4f38df6135b5a4af329e8 (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 = "../salakood";
}