Skip to content

Instantly share code, notes, and snippets.

@gemfarmer
Created January 20, 2017 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gemfarmer/de4b572657245a323139ba7b1b351fb2 to your computer and use it in GitHub Desktop.
Save gemfarmer/de4b572657245a323139ba7b1b351fb2 to your computer and use it in GitHub Desktop.
Type in the developer tools console to get a list of the headings on a given webpage
for (var i = 0, headings = $$('h1,h2,h3,h4,h5,h6'); i < headings.length; i++)
console.log(headings[i].textContent.trim() + " " + headings[i].tagName, headings[i]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment