Skip to content

Instantly share code, notes, and snippets.

@vasilisvg
Created November 21, 2015 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vasilisvg/e79dae967e25d3ce1d64 to your computer and use it in GitHub Desktop.
Save vasilisvg/e79dae967e25d3ce1d64 to your computer and use it in GitHub Desktop.
List all letters used on a page.
var text = document.body.innerText;
var letters = '';
var i = 0;
while ( i < text.length ) {
var isithere = letters.split(text[i]);
if (isithere.length == 1) {
letters += text[i];
}
i++;
}
var textarea = document.createElement('textarea');
textarea.innerHTML = letters;
textarea.setAttribute('style','position:fixed;top:5vh;left:5vw;height:90vh;width:90vw;box-shadow:0 0 5vmax black;background:white');
document.body.appendChild(textarea);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment