title: how to pass user input from one html page to another using local storage
body: <p>I have tried searching other links but did not find any solution.</p>
  
  <p>I have this particular code</p>
  
  <pre><code> &lt;input type= "text" id="tname" placeholder="Enter Name"/&gt;
   &lt;input type="text" id="tcontact" placeholder="Enter Contact No."/&gt;
   &lt;input type="text" id="temail" placeholder="Enter Email"/&gt;
   &lt;input type="text" id="tgender" placeholder="Enter Gender"/&gt;
   &lt;input type="text" id="tqual" placeholder="Enter qualification"/&gt;
   &lt;input type="submit" id="display" value="Display"/&gt;
  </code></pre>
  
  <p>I want to pass these user inputs to another page and just display them using local storage.</p>
  
  <p>The javascript code which I have used here is as follows</p>
  
  <pre><code>  function connector_id(global)
     {
      var sname =document.getElementById("tname");
      var scontact =document.getElementById("tcontact");
      var semail =document.getElementById("temail");
      var sgender =document.getElementById("tgender");
      var squal =document.getElementById("tqual");
  
      localStorage.sname = sname;
      localStorage.scontact = scontact;
      localStorage.semail = semail;
      localStorage.sgender = sgender;
      localStorage.squal = squal;
    }
  </code></pre>
  
  <p>how should i use these localStorage variables to access the user input in the second page. this is where i am facing problem. dont know how to do it.</p>
  
  <p>i have also found this particular code in context to my search but didnt understand this following code</p>
  
  <pre><code>  (function (global) {
    document.getElementById("display").addEventListener("click", function () {
         global.localStorage.setItem("mySharedData",document.getElementById("output").value);
  }, false);}(window));
  </code></pre>