document.getSelection() method returns a selection object representing the range of text selected by the user, or the current position of the caret.
|Object||Returns a selection object.|
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.