title: Get DOM element at caret position
body: <p>I'm looking for a robust way to find where the active caret on the page is. I've learned the following things (at least about chrome):</p>
  
  <ul>
  <li>Every input and textarea has its own separate caret</li>
  <li>Only one caret can be "active" on the page, meaning that if you press the arrow keys, only one of the carets will be affected</li>
  <li>The active caret does <em>not</em> have to be inside the element document.activeElement (e.g. if you use <code>inputDomNode.setSelectionRange</code>, whatever element that was previously focused remained in focus).</li>
  </ul>
  
  <p>So I'm basically wondering how to figure out which caret will move when you press an arrow key.</p>