Textbox.io 2.x Documentation : editor.content.getSelectedText()

Example

editor.content.getSelectedText()
// Retrieve the current editor text selection
var selectedText = editor.content.getSelectedText();

Returns

String

The text content of the selection. If no text selection exists, an empty string ("") is returned.