title: Using local-storage to change text in button and panel
body: <p>I have this code in my file: (I omitted lots of other irrevelant code)</p>
  
  <pre><code>&lt;div data-role="panel" id="loc_panel"&gt; 
      &lt;h2&gt;Panel Header&lt;/h2&gt;
      &lt;p&gt;info about this stop&lt;/p&gt;
  &lt;/div&gt; &lt;!-- /panel --&gt;
  
  &lt;a href="#loc_panel" class="ui-btn ui-btn-inline ui-corner-all ui-shadow" id="panel_button"&gt;Open Panel&lt;/a&gt;
  
  &lt;a href="#tt_popup" data-role="button" data-rel="popup" class="ui-btn  ui-corner-all" id="button_stop7" data-transition="flip"&gt;button_stop6&lt;/a&gt;
   &lt;a href="#tt_popup" data-role="button" data-rel="popup" class="ui-btn  ui-corner-all" id="button_stop6" data-transition="flip"&gt;button_stop7&lt;/a&gt;
  </code></pre>
  
  <p>I want to change the text in the panel and the button so you can view information about stop 7 if you click on the button stop 7, and for stop 6 if you click on that button. 
  I also want to use local-storage (html5!).</p>
  
  <p>I tried this in a script tag in the head:</p>
  
  <pre><code>$(document).on("pagecreate", function () {
      $("#button_stop6, #button_stop7").on("click", function () {
          $("#tt_popup p").text("Button with ID " + this.id + " was clicked");
  
          localStorage.setItem('id','this.id');
          var id = localStorage.getItem('id');
          document.write(id);
          document.getElementById("panel_button").value= id;
  
      });
  });
  </code></pre>
  
  <p>When I run it, the page goes to a blank screen with <code>this.id</code> written on it. So the part of setting 'this.id' to the localstorage works, but I of course don't want the string <code>this.id</code> added to the local storage, I want the id to be set to the local storage.</p>
  
  <p>The value on the panel button doesn't change.</p>
  
  <p>I'm not even close to writing correct javascript, but I'm trying my best to learn!</p>
  
  <p>As you can see the javascript for the panel info is also missing, so like 
       document.getElementById("panel_info").value= "the value corresponding to the id...";
  But ... one thing at a time.</p>