blob: 7f21f653673fdd48610b7093652b956233a01fb4 (
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
|
const spans = document.querySelectorAll("span");
if (localStorage.roll != undefined){
let roll = localStorage.roll;
spans[0].innerHTML = roll;
delete localStorage.roll;
if (roll == 'Kaitseliitlase'){
document.querySelector('h3').innerHTML = 'Baltiketti andmed:';
spans[1].innerHTML = 'Asula: ' + localStorage.asula;
spans[2].innerHTML = 'Kaugus: ' + localStorage.kaugus;
delete localStorage.asula;
delete localStorage.kaugus;
}
else if (roll == 'Direktori'){
document.querySelector('h3').innerHTML = 'Baltiketti andmed:';
spans[3].innerHTML = 'Baltiketi pikkus: ' + localStorage.teekond;
spans[1].innerHTML = 'Asula: ' + localStorage.asula;
spans[2].innerHTML = 'Kaugus: ' + localStorage.kaugus;
console.log(localStorage.teekond);
delete localStorage.asula;
delete localStorage.kaugus;
delete localStorage.teekond;
}
}
|