Skip to content

Instantly share code, notes, and snippets.

@CrocoDillon
Last active December 28, 2015 00:29

Revisions

  1. CrocoDillon renamed this gist Nov 11, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. CrocoDillon renamed this gist Nov 11, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. CrocoDillon created this gist Nov 11, 2013.
    11 changes: 11 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    var classes = [];
    Array.prototype.forEach.call(document.querySelectorAll('*'), function(el) {
    el.className.split(/\s/).forEach(function(cl) {
    if (cl && classes.indexOf(cl) == -1)
    classes.push(cl);
    });
    });
    classes.sort();
    classes.forEach(function(cl) {
    console.log(cl);
    });