Get the text of the selection
Alternatively, since the toString member function is called automatically by some functions when converting the object to a string, you don't always have to call it yourself.
Deselect everything that is selected
Select the contents of an element
It may be necessary to first remove all the ranges of the previous selection, as most browsers don't support multiple ranges.