TX Text Control .NET Server

Javascript: TXTextControl.selection Property

Property|Introduced in 24.0

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.selection

Examples

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);