title: How to make a keypress trigger a link
body: <p>I am trying to make code where a button press will activate a a href link. This is the code I have. </p>
  
  <p><strong>HTML :</strong></p>
  
  <pre><code>&lt;a id="#next" href="talonbragg.com"&gt;↵&lt;/a&gt;
  &lt;a id="#previous" href="talonbragg.com"&gt;↳&lt;/a&gt;
  </code></pre>
  
  <p><strong>JS :</strong></p>
  
  <pre><code>$(document).ready(function() {
      document.onkeydown = function() 
      {
          var j = event.keyIdentifier
          if (j == "Right")
              window.location = nextUrl
          else if (j == "Left")
              window.location = prevUrl            
      }
  });
  
  $(document).ready(function() {
      var nextPage = $("#next")
      var prevPage = $("#previous")
      nextUrl = nextPage.attr("href")
      prevUrl = prevPage.attr("href")
  });
  </code></pre>
  
  <p>Can someone please help?</p>