title: JS not working. What is wrong?
body: <p>I have this code:</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>window.store = {
          localStoreSupport: function() {
              try {
                  return 'localStorage' in window &amp;&amp; window['localStorage'] !== null;
              } catch (e) {
                  return false;
              }
          },
          set: function(name,value,days) {
              if (days) {
                  var date = new Date();
                  date.setTime(date.getTime()+(days*24*60*60*1000));
                  var expires = "; expires="+date.toGMTString();
              }
              else {
                  var expires = "";
              }
              if( this.localStoreSupport() ) {
                  localStorage.setItem(name, value);
              }
              else {
                  document.cookie = name+"="+value+expires+"; path=/";
              }
          },
          get: function(name) {
              if( this.localStoreSupport() ) {
                  var ret = localStorage.getItem(name);
                  //console.log(typeof ret);
                  switch (ret) {
                    case 'true': 
                        return true;
                    case 'false':
                        return false;
                    default:
                        return ret;
                  }
              }
              else {
                  var nameEQ = name + "=";
                  var ca = document.cookie.split(';');
                  for(var i=0;i &lt; ca.length;i++) {
                      var c = ca[i];
                      while (c.charAt(0)==' ') c = c.substring(1,c.length);
                      if (c.indexOf(nameEQ) == 0) {
                          ret = c.substring(nameEQ.length,c.length);
                          switch (ret) {
                            case 'true': 
                                return true;
                            case 'false':
                                return false;
                            default:
                                return ret;
                          }
                      }
                  }
                  return null;
              }
          },
          del: function(name) {
              if( this.localStoreSupport() ) {
                  localStorage.removeItem(name);
              }
              else {
                  this.set(name,"",-1);
              }
          }
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;input id="a" placeholder="Var Name" /&gt;&lt;br&gt;
      &lt;input id="b" placeholder="Var Value" /&gt;&lt;br&gt;
      &lt;button onclick="n()"&gt;Save this var&lt;/button&gt;&lt;br&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;input id="s" placeholder="Var to show" /&gt;&lt;br&gt;
      &lt;button onclick="m()"&gt;Get the var's&lt;/button&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;input id="v" placeholder="var's to delete" /&gt;&lt;br&gt;
      &lt;button onclick="del()"&gt;Delete var's&lt;/button&gt;
      &lt;/body&gt;
      &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Why isn't it working? It isn't saving the inputs, it keeps returning "null".
  Could anyone give me a tip on what i did wrong here? I can't figure it out. It worked before, i did some minor changes but i don't know what i did anymore. Thanks in advance!</p>