document.addEventListener('DOMContentLoaded', () => { let btn = document.querySelector('.modalButton'); btn.click(); }); const kone = document.querySelector(".kone"); kone.addEventListener('input', () => { let koneWordCount = document.querySelector(".kone").innerHTML.split(' ').length; if (koneWordCount > 100) moveOnEnable(); }) // If Done function moveOnEnable(){ const btn = document.querySelector(".moveOn"); btn.disabled = false; localStorage.setItem("roll", "Direktori"); btn.onclick = () => location.href = "../../../endPage"; }