Selection.toString() method returns a string
currently being represented by the selection object, i.e. the currently selected text.
A string representing the selection.
This method returns the currently selected text.
alert(window.getSelection()); // What is called alert(window.getSelection().toString()); // What is actually being effectively called.
|Selection API |
BCD tables only load in the browser
Selection, the interface it belongs to.