Skip to content

Instantly share code, notes, and snippets.

@oguzhancvdr
Created October 22, 2022 19:50
Show Gist options
  • Save oguzhancvdr/0bf068380e5c01920d5a8cec0002a7b9 to your computer and use it in GitHub Desktop.
Save oguzhancvdr/0bf068380e5c01920d5a8cec0002a7b9 to your computer and use it in GitHub Desktop.
const getSelectedText = () => window.getSelection().toString();
getSelectedText(); //Return selected content
@oguzhancvdr
Copy link
Author

get selected text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment