METHOD:
Document::getSelection
document.getSelection(
)
This method can be
used to return a string containing any selected text in the current document.
The following code, when placed in a form in the current document, will
display any selected text in a message box when the button is clicked.
Code:
<INPUT TYPE="BUTTON" NAME="selectString" VALUE="Show
any highlighted text" onClick="alert('The following text is
selected:\n'+document.getSelection());">
|