Last active
August 29, 2015 14:10
-
-
Save ssp/c09055a5e9df8fb5a30c to your computer and use it in GitHub Desktop.
Revisions
-
ssp revised this gist
Nov 26, 2014 . 1 changed file with 1 addition and 1 deletion.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 @@ -5,7 +5,7 @@ iterate = function (e, level) { for (var i = 0; i < level; i++) { logString += '>'; } logString += this.nodeName + ' '; if (this.id) { logString+= '#' + this.id + ' '; } if (typeof this.className === 'string') { logString += '.' + this.className.split(' ').join(' .'); } message += logString + "\n"; message += iterate($(this), level + 1); } ); -
ssp created this gist
Nov 26, 2014 .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,17 @@ iterate = function (e, level) { var message = ''; e.children().each( function() { var logString = ''; for (var i = 0; i < level; i++) { logString += '>'; } logString += this.nodeName + ' '; if (this.id) { logString+= '#' + this.id + ' '; } if (this.className) { logString += '.' + this.className.split(' ').join(' .'); } message += logString + "\n"; message += iterate($(this), level + 1); } ); return message } iterateAll = function () { console.log(iterate($('body'), 0)); }