title: Save data to local storage
body: <p>I'm trying to set a bush of variables in local storage but the function doesn't run, I've tried to get the value but without luck, How can I save fields in Local storage?</p>
  
  <pre><code>function setPerson(){
  var person = { 'name': getElementById('name'), 'photo': getElementById('photo')};
  
  // Put the object into the storage
      alert(person);
      localStorage.setItem('person', JSON.stringify(person));
  };
  </code></pre>
  
  <p><strong>HTML</strong>
   In the HTML I'm from fields put values into tags and they are populated, but when I try to fetch them and save them nothing is happening...</p>
  
  
  
  </p>
  
  <p>I also tried to out fixed values in there and then the alert is displayed, but then it only says object and not the value</p>
  
  <pre><code>var testObject = { 'one': 1, 'two': 2, 'three': 3 };
  
  // Put the object into storage
  localStorage.setItem('testObject', JSON.stringify(testObject));
  
  // Retrieve the object from storage
  var retrievedObject = localStorage.getItem('testObject');
  alert('retrievedObject: ', JSON.parse(retrievedObject));;
  </code></pre>