title: How do I find out which DOM element has the focus?
body: <p>I would like to find out, in JavaScript, which element currently has focus. I've been looking through the DOM and haven't found what I need, yet. Is there a way to do this, and how?</p>
  
  <p>The reason I was looking for this:</p>
  
  <p>I'm trying to make keys like the arrows and <code>enter</code> navigate through a table of input elements. Tab works now, but enter, and arrows do not by default it seems. I've got the key handling part set up but now I need to figure out how to move the focus over in the event handling functions.</p>