title: sessionStorage onclick set value
body: <p>I have 4 divs, and depending on what the user clicks I want to set a variable on each of them, which I then want to save using sessionStorage.</p>
  
  <pre><code>&lt;div id="1" onClick="sessionStorage.id=1"&gt;Select Me as 1&lt;/div&gt;
  &lt;div id="2" onClick="sessionStorage.id=2"&gt;Select Me as 2&lt;/div&gt;
  &lt;div id="3" onClick="sessionStorage.id=3"&gt;Select Me as 3&lt;/div&gt;
  &lt;div id="4" onClick="sessionStorage.id=4"&gt;Select Me as 4&lt;/div&gt;
  </code></pre>
  
  <p>Then on the <code>&lt;head&gt;&lt;/head&gt;</code> area I've added:</p>
  
  <pre><code>sessionStorage.setItem("id", "");
  sessionStorage.getItem("id");
  alert(id);
  </code></pre>
  
  <p>My problem is that the values are not changing and the <code>onclick</code> doesn't see to be storing the new values.</p>
  
  <p>How can I do this right?</p>