Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html lang="en">
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
  <title>untitled</title>
</head>
<body>
  <header>
    <h1> My Simple To-Do List </h1>
  </header>
  
  <section>
    <ul id="edit" contenteditable="true">
      <li></li>
    </ul>
  </section>
  <em>Add some items, and refresh the page. It'll remember what you typed.</em>
</body>
</html>  
 
$(function() {
  
  var edit = document.getElementById('edit');
  
  $(edit).blur(function() {
    localStorage.setItem('todoData', this.innerHTML);
  });
  
  // when the page loads
  if ( localStorage.getItem('todoData') ) {
    edit.innerHTML = localStorage.getItem('todoData'); 
  }
  
  // to reset
  // localStorage.clear();
  
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers