summaryrefslogtreecommitdiff
path: root/rannak/mangud/direktor/kone/script.js
blob: 1904623be0d23692426f289861dd4a5744270a0b (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
document.addEventListener('DOMContentLoaded', () => {
    let btn = document.querySelector('.modalButton');
    btn.click();
});

let koneText = '';


const kone = document.querySelector(".kone");
kone.addEventListener('input', () => {
    let koneWordCount = document.querySelector(".kone").innerHTML.split(' ').length;
    
    koneText = event.target.innerHTML;

    if (koneWordCount > 50)
        moveOnEnable();
})




// If Done

function moveOnEnable(){
    const btn = document.querySelector(".moveOn");
    btn.disabled = false;
    localStorage.setItem("roll", "Direktori");
    localStorage.setItem("kone", koneText);
    btn.onclick = () => location.href = "../../../endPage";
}