title: Append local storage item in jQuery
body: <p>I am trying to show a list of previous locations searched for. I am using session storage across the website, and local storage specifically for the search history.</p>
  
  <p>Currently </p>
  
  <pre><code>if (typeof(Storage) !== "undefined") {
  
      //saves name in local storage (for histoy list)
      localStorage.setItem("name", currentWeather.name);
  
      //saves name in session storage - could be other things
      sessionStorage.setItem("name", currentWeather.name);
  
      // Retrieve session storage name to display back current location on search page
      document.getElementById("name").innerHTML = sessionStorage.getItem("name");
  
      // History
      var previous = {
          location : $("#name").val(), 
      }
  
      var record = JSON.stringify(previous.location);
      localStorage.setItem(previous.location, record); 
  
      for (var i = 0; i &lt; localStorage.length; i++){
      $("#record").append(localStorage.getItem(localStorage.key(i)));
      }
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;p&gt;Location set to: &lt;span id="name"&gt;&lt;/span&gt;&lt;/p&gt;
  
  
  &lt;p&gt;Record:&lt;/p&gt;
  &lt;a id="record"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>So before trying to put into a list, I just wanted to get the locations to simply output. At the moment it is coming out like this:</p>
  
  <p>""Manchester""Edinburgh</p>
  
  <p>On chrome application tab, the session storage shows a key for name, and the latest name is appearing there. It also shows a blank key with a value of <code>""</code> and I don't understand why or how to fix this.</p>