title: How do I get the value of a clicked button on previous page
body: <p>My Index.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;h1&gt;My First Heading&lt;/h1&gt;
  &lt;p&gt;My first paragraph.&lt;/p&gt;
  &lt;button onclick=&quot;document.location='target.html'&quot; name=&quot;this&quot; type=&quot;submit&quot; value=&quot;hello&quot; &gt;target&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>My Target.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;h1&gt;2nd page&lt;/h1&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I would like to access the have access to the value of the clicked button on index.html so i can use it anywhere on the target.html page</p>
  <p>In my head it looks something like this...</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  
  var buttonval = value of button click
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;h1&gt;2nd page&lt;/h1&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Ideally I would like to achieve this using only html and java script</p>