title: Information not saving into Local Storage
body: <p><strong>Java Script</strong> </p>
  
  <pre><code>function getid() {
      'use strict';
      var pass1, pass2;
      pass1 = document.getElementById("pass1").value;
      pass2 = document.getElementById("pass2").value;
      if (pass1 !== pass2) {
          window.alert("Passwords Do not match");
          document.getElementById("pass1").value = "";
          document.getElementById("pass2").value = "";
  
      } else {
          logininfo[index] = {
              fname: document.getElementsByName("firstName").value,
              lname: document.getElementsByName("lastNane").value,
              student: document.getElementsByName("studentn").value,
              password: document.getElementsByName("password2").value
          };
          index++;
          localStorage.setItem("login", JSON.stringify(logininfo));
          window.location = "login.html";
      }
  }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form&gt;
    &lt;div class="login-card"&gt;
      &lt;img src="rsz_logo.gif" alt="North Park Logo" &gt;
  
      &lt;h1&gt;Register&lt;/h1&gt;&lt;br&gt;
      &lt;input type="text" name="firstName" placeholder="First Name" required&gt;
      &lt;input type="text" name="lastName" placeholder="Last Name" required&gt;
      &lt;input type="text" name="studentn" placeholder="Student Number" required&gt;
      &lt;input type="password" name="pass1" placeholder="Password" required&gt;
      &lt;input type="password" name="pass2" placeholder="Re-type Password" required&gt;
  
      &lt;input type="submit" name="login" class="login login-submit" value="Register" onclick="getid()"&gt;
  
      &lt;div class="login-help"&gt;
        &lt;a href="login.html"&gt;Back to Login&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>What I'm trying to do here is password validation to see if pass1 = pass2, if they are equal then proceed to the login page and store the information into the local storage but if not then clear the password fields for the person to retype the passwords.</p>
  
  <p>The information doesn't save into the local storage. After I click the submit button the page refreshes and the information is viable in the url but not in the local storage. I am trying to stick to HTML and Javascript. </p>