selection([start], [end])

Class: TextArea. Method inherited from TextComponent.

Description:

Gets selection object or sets selection by providing start and end positions.

Parameters:

Name Type Description

[start]

number

Start position of selection.

[end]

number

End position of selection. Required if start argument is provided.

Returns:

Returns this component if arguments are provided, otherwise returns Object of format {start: number, end: number, text: string};

Type: Object | this