Created
January 19, 2015 01:51
-
-
Save davidpots/92c2357a82a15471fd91 to your computer and use it in GitHub Desktop.
Revisions
-
davidpots created this gist
Jan 19, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ // On a page with many .item elements, where each element has many tags .item__tag // This will create an array 'tagList' that contains all tags (without duplicates) var tagList = []; $.each( $('.item__tag'), function(i,obj) { nextTag = obj.innerText; if ($.inArray(nextTag,tagList) == -1) { tagList.push( nextTag ); } } );