Answer the question
In order to leave comments, you need to log in
Why does the localStorage value disappear when the page is refreshed?
Hello everyone
Inspired by the advice of one lion ( DevMan, hello, if you are reading), I decided to make a competitor to Evernote using localStorage, but there is a problem.
I have this funk to save value from input:
function saveValue() {
save_button.addEventListener('click', function (e) {
e.preventDefault();
var input = document.getElementById('note_' + count);
var placeHolder = document.getElementById('text');
localStorage.setItem("note_number_" + count, input.value);
var hello = localStorage.getItem("note_number_" + count);
return placeHolder.innerHTML = hello;
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question