/ Published in: jQuery
this shows you how to use localStorage to have a page remember content that has been edited with the html5 attribute, contenteditble
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//demo of localStorage $(function() { var someSection = document.getElementById('someSection'); $(someSection).blur(function() { localStorage.setItem('toDoData', this.innerHTML); }); if(localStorage.getItem('toDoData')) { someSection.innerHTML = localStorage.getItem('toDoData'); } }); <ul id="someSection" contenteditable="true"> <li>add stuff here</li> </ul>