YouTip LogoYouTip

Met Win Getselection

# Window getSelection() Method [![Image 8: Window Object Reference Manual](#) Window Object](#) * * * ## Definition and Usage The getSelection() method represents the text range selected by the user or the current position of the cursor. ## Syntax window.getSelection(); * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) All major browsers support the focus() method. * * * ## Example ## Example Read the selected content: function foo(){let selObj = window.getSelection(); alert(selObj.toString()); } [Try it Β»](#) * * Window Object](#)
← Number Atan2Pandas Dataframe β†’