Skip to content

Instantly share code, notes, and snippets.

@dan-laskowski
Created May 5, 2021 12:09
Show Gist options
  • Save dan-laskowski/e3c7df400221c2c702eb6f620fd2e33c to your computer and use it in GitHub Desktop.
Save dan-laskowski/e3c7df400221c2c702eb6f620fd2e33c to your computer and use it in GitHub Desktop.
[Get the text that the user has selected] #javascript #js #selected #text
/ Get the text that the user has selected
const getSelectedText = () => window.getSelection().toString();
getSelectedText();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment