I am building a todo app with localstorage via javascsript,my problem is if i save a note like
First
Second
Third
Then i get in saved not "First Second Third", Is there a way to fix it? This is the javascript function to save the notes
function SaveNotes() {
var todo = document.getElementById("txtToDo").value;
var storage = JSON.parse(localStorage.getItem('ToDoList'));
var arrayLength = storage.length;
storage[arrayLength + 1] = todo;
localStorage.setItem('ToDoList', JSON.stringify(storage));
loadNotes();
clearNote();
}
the whole code and demo you can find here https://jsfiddle.net/r58yzj6v/