Simplify text-selection example.

The text-selection example was changed to remove jQuery usage, re-structure and add more comments.