selectionEnd

The selectionEnd property of the HTMLTextAreaElement interface specifies the end position of the current text selection in a textarea element.

MDN Reference