Skip to content

Instantly share code, notes, and snippets.

@rohozhnikoff
Last active August 29, 2015 14:01
Show Gist options
  • Save rohozhnikoff/6b760fc3fc727f5b2bea to your computer and use it in GitHub Desktop.
Save rohozhnikoff/6b760fc3fc727f5b2bea to your computer and use it in GitHub Desktop.
$('<script>', {src: '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js'}).appendTo('head');
$(function(){
var arr = [];
$('*').each(function(i, el){
var classe = $(el).attr('class');
if(classe && classe.length) {
arr.push(classe.split(' '));
}
});
arr = _(arr).sortBy();
arr = _(arr).flatten();
arr = _(arr).uniq();
console.log(arr);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment