[A useful overview of Ranges in an HTML Document][link], with examples for (of import to myself) getting the text a user has selected so you can do stuff with it.
Of note: None of the examples here seem to work on iOS WebKit.
[link]: http://www.quirksmode.org/dom/range_intro.html “Introduction to Range”