This version of Unity is unsupported.

TextElement.selection

public UIElements.ITextSelection selection;

Description

Retrieves this TextElement's ITextSelection