title: Redirect routes in HTML using Javascript
body: <p>I have 3 html files that I want to link together. The three files are <code>button.html</code>, <code>option1.html</code>, <code>option2.html</code> and all three files are stored in one src folder.</p>
  <p>The <code>button.html</code> is a simple webpage that contains two buttons:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
        &lt;title&gt;Page Title&lt;/title&gt;
        &lt;script type=&quot;text/javascript&quot;&gt;
          document.getElementById(&quot;option1&quot;).onclick = function () {
              location.href = &quot;./option1.html&quot;;
          };
          document.getElementById(&quot;option2&quot;).onclick = function () {
              location.href = &quot;./option2.html&quot;;
          };
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
        &lt;button type=&quot;button&quot; id=&quot;option1&quot;&gt;Option 1&lt;/button&gt;
        &lt;button type=&quot;button&quot; id=&quot;option2&quot;&gt;Option 2&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>and the two other .HTML file are regular pages each w/ different content.</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Option 1/2&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
    // different data contained for option1.html and option2.html
    &lt;h1&gt;Heading for Option 1 or 2&lt;/h1&gt;
    &lt;p&gt;Paragraph for Option 1 or 2&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I'm not sure what I'm doing wrong but even with the onClick() functions for each buttons, the buttons won't link to the other HTML files.
  I'm wondering if I should have some kind of link tag in the header for the two HTML files. Also, I'm not very certain about that <code>location.href</code> line does in the script tag of <code>button.html</code> file. I just found some resources online to try this out.</p>
  <p>Also, I need to do this using ONLY Vanila Javascript, HTML and CSS.</p>
  <p>Please help me out. Thanks!!</p>