Javascript: TXTextControl.selection Property
Description
Returns the current selection or sets the selection's position and length. The setter must be used as follows: TXTextControl.selection = { start: 2, length: 5 }
Syntax
<Selection> TXTextControl.selectionExamples
The following example demonstrates TXTextControl.selection in a practical document-editing workflow. It returns the current selection or sets the selection's position and length. The setter must be used as follows: TXTextControl.selection = { start: 2, length: 5 }.
const selection = tXTextControl.selection;
console.log("selection:", selection);