Created
March 24, 2012 14:35
-
-
Save mortenjust/2183587 to your computer and use it in GitHub Desktop.
localstorage javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var edit = document.getElementById('editableList'); | |
$(edit).blur(function() { | |
localStorage.setItem('toDoData', this.innerHTML); | |
}); | |
//when the page loads | |
if(localStorage.getItem('toDoData')){ | |
edit.innerHTML = localStorage.getItem('toDoData'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment