To get a selected string, use Text Property.
The following example demonstrates how to get a selected string and display it.
str = document.selection.Text;
alert( str );
str = document.selection.Text
alert str
Send feedback on this topic to Emurasoft