method
getSelection

Selection getSelection( )

Returns the currently selected text.

Other resources