title: I can't seem to get local storage working
body: <p>My code is not working when I try to save and load a value. I looked this up multiple times with no definitive answers. Any help would be appreciated!   </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var1 = 1
  
  function save() {
    localStorage.setItem("var1", string(var1));
  }
  function load() {
    var1 = localStorage.getItem("var1");
  }
  function up() {
    var1 += 1
    document.getElementById("test").innerHTML = var1
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p id="test"&gt;1&lt;/p&gt;&lt;br&gt;
  &lt;button onclick="up()"&gt;up1&lt;/button&gt;
  &lt;button onclick="save()"&gt;save&lt;/button&gt;
  &lt;button onclick="load()"&gt;load&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>