Posted By

adriamooney on 08/04/10


Tagged

jquery html5 contentEditable localstorage


Versions (?)

jquery localStorage for contenteditable content to remember edited content


 / Published in: jQuery
 

URL: http://net.tutsplus.com/tutorials/html-css-techniques/25-html5-features-tips-and-techniques-you-must-know/

this shows you how to use localStorage to have a page remember content that has been edited with the html5 attribute, contenteditble

  1. //demo of localStorage
  2.  
  3. $(function() {
  4.  
  5. var someSection = document.getElementById('someSection');
  6.  
  7. $(someSection).blur(function() {
  8. localStorage.setItem('toDoData', this.innerHTML);
  9. });
  10.  
  11. if(localStorage.getItem('toDoData')) {
  12. someSection.innerHTML = localStorage.getItem('toDoData');
  13. }
  14. });
  15.  
  16. <ul id="someSection" contenteditable="true">
  17. <li>add stuff here</li>
  18. </ul>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: louboutinshoes on August 4, 2010

just because we love christian louboutin,also we think it will made you be more sexy.IN christian louboutin sale,you can get your luxury christian louboutin shoes at cheap price.christian louboutin shoes(born 1964) is a footwear designer who launched his line of high-end women's shoes in France in 1991.trademark protection of this red sole design.cheap christian louboutin shoes,louboutin shoes,christian louboutin shoes on sale,christian louboutin sale,cheap ugg boots,ugg boots saleugg classic tall and ugg classic cardy,ugg classic short,cheap christian louboutin,christian louboutin pumps,cheap christian louboutin

You need to login to post a comment.