title: Shift focus onkeydown - JavaScript Only - No jQuery
body: <p>I would like to be able to navigate through some of the focusable elements on my webpage with the arrow keys, using JavaScript only.</p>
  
  <p>I found a great solution <a href="https://stackoverflow.com/questions/11088674/shift-focus-with-arrow-keys-in-javascript#11088844">here</a>. Only thing is, it uses jQuery, which I don't want to use. I was told by the author of that answer that it is possible to achieve the same effect with JavaScript only. I just don't know how, or even what to look for. I'm still a beginner, so I am sorry if it is an obvious question.</p>
  
  <p>This is the jQuery version of what I want to achieve:</p>
  
  <pre><code>&lt;input class='move' /&gt;&lt;input class='move' /&gt;&lt;input class='move' /&gt;
  
  $(document).keydown(
      function(e)
      {    
          if (e.keyCode == 39) {      
              $(".move:focus").next().focus();
          }
          if (e.keyCode == 37) {      
              $(".move:focus").prev().focus();
          }
      }
  );
  </code></pre>