For web pages which don't include a feature to count words or characters on the page, a simple workaround is to use a bookmarklet. A bookmarklet is a bookmark stored in a web browser that contains commands (usually in JavaScript) that add new features to the browser. Bookmarklets are supported by most modern web browsers, possibly with limitations on mobile devices.
HOW TO:
- Create any bookmark and store it in the toolbar of your web browser. If it's stored elsewhere it will be much less practical and might not work for this specific purpose.
- Edit the bookmark
- change its name to e.g. "Count Words" or something significant to you
- change its URL to the following single line (copy-paste it):
- 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.")})();
- save the changes if needed in your browser, else simply return to this wiki page
- To use it, simple select part of the text on a web page and click the bookmark in the toolbar of your browser.
- A pop-up shows the character and word count