I\'m trying to make, a simple To-Do list in jQuery and I\'ve ran into a problem. This is my first time trying to use localStorage. So after making structure for my
localStorage
You should first check if something already exists in the localStorage:
if (localStorage.getItem("todolist") != null) { $('#todoList').html(localStorage.getItem("todolist")); // This reads items in our local storage }
Check this update: http://jsbin.com/damedomepi/1/edit?html,js,output