title: How to make an HTML back link?
body: <p>What is the simplest way to create an <code>&lt;a&gt;</code> tag that links to the previous web page? Basically a simulated back button, but an actual hyperlink. Client-side technologies only, please.</p>
  
  <p><strong>Edit</strong><br />
  Looking for solutions that have the benefit of showing the URL of the page you're about to click on when hovering, like a normal, static hyperlink. I'd rather not have the user looking at <code>history.go(-1)</code> when hovering on a hyperlink. Best I've found so far is:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script&gt;
    document.write('&lt;a href="' + document.referrer + '"&gt;Go Back&lt;/a&gt;');
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Is <code>document.referrer</code> reliable? Cross-browser safe? I'll be happy to accept a better answer.</p>