selectionEnd

Gets or sets the end position or offset of a text selection.

MDN Reference