jCaret is a full-power caret Plugin.
It provides basic selection detection in textbox and textarea giving the following information
The start postion of caret/cursor
The end postion of caret/cursor
The selected text
It enable programmer highlight part of the text in textbox or textarea by:
providing the text directly
providing the start and end position
providing the regular expression for selecting text
It provides the replace() method, which is useful in providing input filter of a textbox or textarea.
See online demostration jCaret