docs: https://javascript.info/selection-range
This video shows to get the selected text in textarea by using the selection API using the range method and substr to slice it.
The substr() method extracts a part of a string.
Watch video JavaScript get selected text in TextArea | JavaScript selection API | substr() online without registration, duration hours minute second in high quality. This video was added by user b3nsh4 23 March 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,857 once and liked it 14 people.