As you see in my code below, When I reload the page, all my UI values change. I want to get data from locale storage after loading the page. Please help me to solve.
document.getElementById('btn-increase').addEventListener('click', ()=>{
const countNumber = document.getElementById('count');
const countStr = countNumber.innerText;
const counts = parseInt(countStr);
const countTotal = counts + 1;
countNumber.innerText = countTotal;
// set in local storage
localStorage.setItem('count', countTotal);
});
const storage = ()=>{
localStorage.getItem('count');
}
storage();