Skip to content

Instantly share code, notes, and snippets.

@noahlearner
Created March 18, 2021 13:12
Show Gist options
  • Save noahlearner/105f61d642a64386b00dc4bb83a51d0c to your computer and use it in GitHub Desktop.
Save noahlearner/105f61d642a64386b00dc4bb83a51d0c to your computer and use it in GitHub Desktop.
javascript:(function(){var a=(document.selection?document.selection.createRange().text:document.getSelection()).toString();alert(a.length?"Characters: "+a.length+"\nWords: "+a.replace(/\s{2,}/g," ").split(" ").length:"No text selected.")})();
@noahlearner
Copy link
Author

  1. Select content on page.
  2. Hit bookmarklet.
  3. An alert opens with a count of words in slection.

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