i am working on a todo project but when i store data in local storage and try to retrive it. After refreshing the browerser, those values stores in local storage are no longer on the display
here is the code
const todolist=document.getElementById('todolist')
const addBtn=document.getElementById('add')
const newNotes=JSON.parse(localStorage.getItem('newNotes'))
addBtn.addEventListener('click',function (e) {
e.preventDefault()
const input=document.getElementById('input').value
const textarea=document.getElementById('textarea').value
const notesInfo={
title:input,
description:textarea
}
newNotes.push(notesInfo)
newNotes.forEach((note)=>{
const html=`
<div class="main">
<h2 id="title">${note.title}</h2>
<p id="para">${note.description}</p>
`
todolist.insertAdjacentHTML('afterbegin',html)
})
localStorage.setItem('newNotes',JSON.stringify(newNotes))
console.log(todolist)
JSON.parse(localStorage.getItem('newNotes'));
}
)