Created
November 16, 2015 14:45
-
-
Save adamhopkinson/82b3fec9583946cb5e2d to your computer and use it in GitHub Desktop.
Outputting a table of contents to the console
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 characters
$('#article-content').find('h1,h2,h3,h4,h5,h6').each(function(i,el) {console.log(i + "\t" + el.tagName + "\t" + $(el).text())}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment