title: Understanding what goes on with textarea selection with JavaScript
body: <p>I am working on an in-browser editor within a <code>textarea</code>.  I have started looking for some information on dealing with <code>textarea</code> selection and found <a href="https://github.com/localhost/jquery-fieldselection" rel="noreferrer">this jQuery plugin, fieldSelection</a> that does some simple manipulation.  </p>
  
  <p>However, it doesn't explain what's going on.</p>
  
  <p>I want to understand more on textarea selection in JavaScript, preferably with a description of both pre-DOM3 and post-DOM30 scenarios.</p>