title: How to get data from form to javascript and redirect to another page?
body: <p>I have a html5 form with name, surname ect. The reason why I'm using  a form is so that the user has to fill in everything, for that I'm using <code>required</code>. I want to save all the data in localStorage, for that I need to move the data to JavaScript. </p>
  
  <p>How do access the data in JavaScript when the <code>submit</code> button is pressed while redirecting the user to another page?</p>
  
  <p>This is the code:</p>
  
  <p><em><strong>Html5</em></strong></p>
  
  <pre><code>&lt;form id="TheForm" method="post"&gt;
     &lt;input type="text" id="Name" placeholder="*Förnamn" required &gt;
     &lt;input type="text" id="Surname" placeholder="*Efternamn" required &gt;
     &lt;input type="email" id="FirstEmail" placeholder="*e-postadress" autocomplete="on" required &gt;
     &lt;input type="email" id="SecondEmail" placeholder="*Verifiera e-postadress" autocomplete="off" required &gt;
     &lt;input type="text" id="Address" placeholder="*Adress" required &gt;
     &lt;input type="submit" id="Submit" onclick="function()" value="Skicka"&gt;
  &lt;/form&gt; 
  </code></pre>