title: Moving up a directory with HTML from JS dom
body: <p>This is my first time posting so any points would be nice about formatting or what not, but here's my problem anyway.</p>
  
  <p>This is my JS Code</p>
  
  <pre><code>document.getElementById('mainnav-up').innerHTML =
  "&lt;div class='banner'&gt;" +
  "&lt;a href='..\index.html'&gt;&lt;div class='button'&gt;&lt;/div&gt;&lt;/a&gt;" +
  "&lt;/div&gt;";
  </code></pre>
  
  <p>Which places a button on my HTML page under :</p>
  
  <pre><code>home/products/product1.html
  &lt;div id="mainnav-up"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>but instead of being taken to</p>
  
  <pre><code>home/index.html
  </code></pre>
  
  <p>I am instead taken to </p>
  
  <pre><code>home/products/..index.html
  </code></pre>
  
  <p>Which is non-existent.
  If I then hard code the link into the <code>home/products/product1.html</code> page it takes me to the index page correctly, but I'd like to be able to just edit one piece of code for the whole website.</p>