selectionEnd
SelectionEnd is a property used with text input controls in web browsers to indicate the end position of the current text selection within the element’s value. It is part of the pair selectionStart and selectionEnd, which together describe the selected range of characters. The property applies to HTMLInputElement and HTMLTextAreaElement and is supported for text-based input types such as text, search, url, tel, and password in modern browsers.
The value of selectionEnd is a non-negative integer between 0 and the length of the element’s value.
Setting selectionEnd can move the caret or change the selected range depending on the current selectionStart
Compatibility notes: selectionStart and selectionEnd are widely supported in modern browsers. Older browsers, notably some versions